https://prefect.io logo
Title
a

Aaron Gonzalez

02/24/2023, 4:57 PM
Something I just noticed was that some deployments I just pushed to Prefect Cloud have parameters that don't seem to be showing up correctly in the UI. In my
deployments.py
I wrote:
def deploy_factory(name:str, flow, param: dict = dict(), cron: str = '') -> Deployment:

    kwargs = {
        'flow': flow,
        'name': name,
        'infrastructure': CloudRunJob.load(f"aether-flows-cloud-run-job-{ENV}"),
        'work_queue_name': f"{ENV}_aether",
        'version': VERSION,
        'output': f'{name}.yaml',
        'skip_upload': True,
    }

    if param:
        kwargs['parameters'] = param,
    if cron:
        kwargs['schedule'] = CronSchedule(cron=cron)

    return Deployment.build_from_flow(**kwargs)


aether_space_metrics_1h_parquet_rsync = deploy_factory(
    name=f'aether_space_metrics_1h_parquet_rsync_{ENV}',
    flow=space_metrics_parquet_rsync,
    param={'date': 'current', 'agg_window': '1h'},
    cron=sched('0 23 * * *')
)
aether_space_metrics_1h_parquet_rsync.apply(work_queue_concurrency=20)
I'm currently still testing by launching some custom runs where I am manually entering a date (e.g.
2023-02-01
) and agg_window (
1h
), but I'm curious if this is just a UI bug or an actual prod run with default params is going to use what I defined in code 🤔
update. Yeah it looks like the default params weren't correctly set. 😢 Quick fix was to just manually update them in the UI, but still not sure why the python code didn't yield the correct configuration. I've used the same exact pattern for almost all of my deployments. It's never been an issue in the past.
1