for my metaflow pipeline, I have a parameter like ...
# ask-metaflow
g
for my metaflow pipeline, I have a parameter like
Copy code
model_slugs = Parameter(
        "model_slugs",
        default=["foo", "bar"],
        type=JSONType,
    )
https://github.com/csscompany-enterprise/monorepo/blob/fafc54072082ff868869406e12a[…]istics-modeling/olm-flows/olm_flows/quantile_regression_flow.py, the flow worked when I trigger it the first time, but on following scheduled runs, it complains
Copy code
Usage: flow.py init [OPTIONS]
Try 'flow.py init --help' for help.

Error: Invalid value for '--model_slugs': [foo, is not a valid JSON object
https://argo.cssinternal.com/workflows/order-logistics-modeling/olmflows.prod.quantiler[…]0-4199800187:main&uid=bc8c1734-06f5-4ad6-950a-8989ec8db984 any thoughts why this could be?
s
@bulky-afternoon-92433 any thoughts here?
h
I think JSONType is supposed to be a string? Can you try with:
Copy code
default='["foo", "bar"]'
Both ways are working for me locally, but I suspect it needs to be a string during the trigger
b
are you using argo events with
@trigger/@trigger_on_finish
or is it a regular flow that is failing on argo? Which version of metaflow are you getting the error with? I'm unable to reproduce the exact error with a jsontype parameter with list default, and there have been a bunch of fixes regarding the parameter defaults that have gone in the past half a year.
g
@hundreds-rainbow-67050, based on https://github.com/Netflix/metaflow/blob/10bfd166df98d5a0e843f87d2491aa13cea30756/metaflow/parameters.py#L92-L99, either string or list should be fine. But I agree in general the doc about how JSONType should be used is not very clear.
@bulky-afternoon-92433, my job was triggered via argo cron workflow. To be more accurate, my experience is that the first manually triggered flow run is fine, but somehow in following run started via cron fail with the above error. It's kind of odd behavior, but doesn't seem to be due to how the default is encoded (string or list). we're using metaflow 2.12.4.