benorbital
05/24/2024, 6:44 PMrun_deployment
as shown in screen shot.
This doesn't seem to work in my testing. I think maybe its the same issue as here.
How are people overriding a single environment variable (not all of them) when creating subflows like this?Robert Banick
05/24/2024, 7:08 PM{
"env" : {
"PREFECT_LOGGING_EXTRA_LOGGERS" : 'blah blah bla'
}
}
Robert Banick
05/24/2024, 7:08 PMbenorbital
05/24/2024, 8:44 PMRobert Banick
05/24/2024, 8:56 PMRobert Banick
05/24/2024, 8:56 PMbenorbital
05/24/2024, 8:56 PMbenorbital
05/24/2024, 9:02 PMbenorbital
05/24/2024, 9:59 PMbenorbital
05/24/2024, 10:00 PMbenorbital
05/24/2024, 10:02 PMrun_deployment
but I suppose its all the same under the hood)benorbital
05/24/2024, 10:06 PMrun_deployment
almost unusable for meNate
05/24/2024, 10:08 PMenv
to a flow run from a deployment without clearing any env
on the work pool
so like basically env = work_pool_env | run_deployment_env
benorbital
05/24/2024, 10:10 PMNate
05/24/2024, 10:17 PMIn [1]: from prefect import get_client
In [2]: async with get_client() as client:
...: wp = await client.read_work_pool(work_pool_name="local")
...:
In [3]: work_pool_env = wp.base_job_template.get('variables').get('properties').get('env').get('default')
In [4]: new_env = work_pool_env | {"GIT_BRANCH": "foo"}
In [5]: new_env
Out[5]: {'bar': 42, 'GIT_BRANCH': 'foo'}
Nate
05/24/2024, 10:18 PMget_current_work_pool_env
and then pass new_env
to run_deployment
as the total env
for that run right?benorbital
05/24/2024, 10:22 PMrun_deployment
uses the same work pool (and their deployments don't have different env var overrides)benorbital
05/24/2024, 10:22 PMNate
05/24/2024, 10:24 PMenv
from the deployment itself if it has overrides, since the overrides are accessible on the deployment object
so there's likely many ways to do this, but whats most convenient for your use case im not surebenorbital
05/24/2024, 10:27 PMbenorbital
05/24/2024, 10:41 PMrun_deployment
would *use (*If I didn't pass any)?
I don't want to assume anything about the deployment in question e.g. I don't want to assume it shares a work-pool with the parent flowAndrew Brookins
05/24/2024, 11:09 PMbenorbital
05/24/2024, 11:14 PMbenorbital
05/28/2024, 1:24 PMjob_variables = {**deployment_vars, **flow_run_vars}
this merge should instead be a recursive merge.
This actually seems like it could be fixed pretty easily. Do you think there's a chance it will get worked on soon?Andrew Brookins
05/28/2024, 2:51 PM