Open atmorling opened 1 month ago
@atmorling thanks for the thoughtful report, and for finding a workaround.
Is it possible that this is happening because, in the examples you give above, DataFrame
is not subscripted with a schema? i.e.
That being said, we the WithJsonSchema
has perhaps always been a little hacky so maybe we can iterate on that a bit.
I wonder also if you hit this because you're the first to put a DataFrame
inside of an Annotated
type. For clarity, note that DataFrame
itself is an Annotated type, and while nested annotations are supported, this may add to the picture of what's affecting the behavior here (or not 🤷 ).
@cisaacstern earlier this week I mentioned coming across a strange issue with optional
AnyDataFrame
/AnyGeoDataFrame
params in a task definition 'breaking' theDataFrame
annotation.Turns out if the param is defined like so:
.. the default
None
is coerced intoDataFrame
, (even if the param is defined in the comp spec explicitly) and causes"default":None
to be added to the JSON schema defined below which borks any subsequent calls toparameters_jsonschema()
https://github.com/wildlife-dynamics/ecoscope-workflows/blob/6facf602292bfe2fcbf80d4a57974cb619855a71/ecoscope_workflows/annotations.py#L42I couldn't find a way to elegantly avoid the coercion, but as an easy workaround if this where to come up, the ol' switcheroo makes the problem go away ie;