https://prefect.io logo
h

Horatiu Bota

02/02/2022, 8:37 AM
hi community & thanks for the help! i've got a parameters json file that i want to pass to a prefect flow using
flow.run(parameters=json.loads(open(file).read()))
-- the parameters file looks something like this:
Copy code
{
    "other_params": {},
    "company_params": {
        "company_id": "ID1",
        "company_name": "Company",
        "datasets": [
            {
                "dataset_label": "label",
                "dataset_url": "URL"
            },
        ]
    }
}
is there any way to access nested values in the actual flow? something like:
Copy code
with Flow("flow") as flow:
        company_params = Parameter("company_params")
        datasets = company_params.get("datasets")
a

Anna Geller

02/02/2022, 10:34 AM
I'm on mobile so hard to type a code example, but selecting elements should work fine e.g. company_params["datasets"]
2 Views