Pedro Sousa Silva
05/05/2025, 1:29 PMglobals
configuration.", so I wonder if there's any workaround to my requirement:
We have a project where the frontend action will trigger my kedro run in Databricks (via Databricks Jobs REST API). Some parameters from the frontend will override some of my default kedro parameters (this works fine), but i also need to override a dataset definition based on one of these parameters. Particularly, i want my dataset to be written to a specific location that depends on a runtime_param `simulation_id`:
my globals.yaml:
root: ${oc.env:AWS_S3_ROOT}
simulation_id: ${uuid:""} # ideally something like ${runtime_params:simulation_id}, but i know it's not possible
folders:
m_frontend: "09_frontend_reporting/${..simulation_id}"
my catalog.yaml:
simulation_json:
type: json.JSONDataset
filepath: ${globals:root}/${globals:folders.m_frontend}/simulation_${globals:simulation_id}.json
What are my options to achieve this?Juan Luis
05/05/2025, 3:55 PMmodel_options:
random_state: "${runtime_params:random, ${globals:my_global_value}}"
which is nice because it provides a way to specify the params, and the defaults are given by globals.yml
would this address your use case?Pedro Sousa Silva
05/05/2025, 3:58 PMPedro Sousa Silva
05/05/2025, 3:58 PMPedro Sousa Silva
05/05/2025, 3:59 PMruntime_params
could be used directly in the catalog!
it's not as clean, though, because my file_path needs to be repeated a lot of times on catalog (with a single global it would become more organized), but it works hereJuan Luis
05/05/2025, 4:10 PMJuan Luis
05/05/2025, 4:10 PM# catalog.yml
_filepath: ${runtime_params:my_file_path}
ds1:
filepath: ${_filepath}
ds2:
filepath: ${_filepath}
(didn't test this, please double check)Pedro Sousa Silva
05/05/2025, 4:14 PM_dbx_con: &dbx_con
type: <dbx_dataset>
catalog: <my_catalog>
mytable:
<<: *dbx_con
database: bronze_sanitized
table: mytable
but never made the connection that this would work for a single variable as well. let me test it!Juan Luis
05/05/2025, 4:16 PMPedro Sousa Silva
05/05/2025, 4:26 PM