You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I took hint from existing date_string_to_datetime preprocessor and wrote my own preprocessor that converts input string argument into an Enum.
.
While the conversion worked, during dag-build phase (Python code-generation), I ended up hitting this block and got Cannot format value {}: no handler for type {}.
.
Was this expected or am i doing something wrong?
Is there a reason why this is restricted?
Is there a workaround?
The text was updated successfully, but these errors were encountered:
oh this is interesting @y2k-shubham . The issue is that Enum is not a supported type for the code that formats the arguments that get passed to operators in the generated DAG code. The formatter is here. As you can see, we have specific handlers for the various types of values that are typically encountered (e.g. strings, datetime, dict, etc), and we just have not ever encountered Enum before.
There are two possible solutions to this:
Rather than generating an Enum, perhaps you can achieve your goal using a <<verbatim string>> (which will be pasted directly into the python dag)?
We can add an Enum formatter to the method I linked up there ^^. This will require a core change and I'd want to make sure it does not introduce any unexpected problems, but in principle I don't see anything wrong with it.
Could you try out solution (1) to see if that works for you? If not, I'm spread a bit thin right now so I can't commit to adding (2) on any near-term timeline, but I'd be open to a contribution if you wanted to do it yourself (and I could help with code pointers etc).
I took hint from existing
date_string_to_datetime
preprocessor and wrote my own preprocessor that converts input string argument into an Enum..
While the conversion worked, during
dag-build
phase (Python code-generation), I ended up hitting this block and gotCannot format value
{}: no handler for type {}
..
The text was updated successfully, but these errors were encountered: