Tim Enders

    Tim Enders

    11 months ago
    Is there a way to set the Prefect Run Configuration default in the UI? Of not, how do I do it on registration. I need to specify a Local config rather than Universal for some jobs.
    Kevin Kho

    Kevin Kho

    11 months ago
    You can’t set the default through the UI, but you can set it for an adhoc run. Flow the flow, it just becomes:
    from prefect.run_configs import LocalRun
    flow.run_config = LocalRun(...)
    After the Flow block
    Tim Enders

    Tim Enders

    11 months ago
    so like this
    with Flow(
        "Project Git/SDK Version",
        # executor=LocalDaskExecutor(),
        state_handlers=[psh.flow_failure],
        executor=LocalExecutor(),
        # result=GCSResult(bucket="platformsh-vendor-prefect"),
    ) as flow:
        project_ids = list_elite_projects()
        info = fetch_system_info.map(project_ids)
        flat_data = flatten_json(flatten(info), "platform")
        schema = generate_schema(flat_data)
        object_uri = upload_gcs(flat_data, "project", "project_system")
        status = gcs_to_bq(
            object_uri,
            "project_system",
            dataset="GCP_PLATFORMAPI_DATASET",
            schema=schema,
        )
    flow.run_config = LocalRun()