Peter Lim
07/14/2023, 7:26 PMPeter Lim
07/14/2023, 8:12 PMDynamicPartitionsDefinition(name="somename")
but using @dynamic_partitioned_config(partition_fn=get_dynamic_partition_keys)
and get the result of Invariant failed. Description: Can't supply a PartitionedConfig for 'config' with a different PartitionsDefinition than supplied for 'partitions_def'.
Am I using the dynamic_partitioned_config
decorator properly?owen
07/14/2023, 10:02 PMload_assets_from_dbt_manifest
integration or are you running dbt from an op? if the former, I'd recommend just setting up a partition_key_to_vars_fn
to convert the given partition key to variables that will be passed into your dbt project. If the latter, you can get the current partition key at runtime from context.partition_key
, then use that to construct arguments to pass into your dbt invocationPeter Lim
07/14/2023, 10:56 PMload_assets_from_dbt_manifest
and your solution with partition_key_to_vars_fn
worked.
Is there a way to expose required config at the launcher level (i.e select partition and it scaffolds the config mapping) to dbt? I have this but looking for how config gets passed. I used to have @static_partitioned_config
attached to it.
Thank you!!
@configured(dbt_cli_resource, config_schema={"vars": dict,"target": str})
def custom_dbt_cli_resource(config):
return {
"vars": config["vars"],
"project-dir": DBT_PROJECT_PATH,
"profiles-dir": DBT_PROFILES_PATH,
"target": config["target"]
}
owen
07/14/2023, 11:00 PMPeter Lim
08/02/2023, 6:57 PMIf the latter, you can get the current partition key at runtime fromI’m trying to invoke runs using ops instead of assets using dagster 1.3, and a lot of features I want to use are tied to ops instead of, then use that to construct arguments to pass into your dbt invocationcontext.partition_key
define_asset_job
Thank you!!owen
08/03/2023, 8:44 PM@op
def do_dbt_stuff(context, dbt: DbtCliClient):
dbt.run(<args go here>, vars={"some_var": context.partition_key})
Alex Kan
08/04/2023, 1:09 PMdynamic_partitioned_config
is deprecated, should we just use a regular PartitionedConfig for supplying run config to partitioned assets that use the new DynamicPartitionsDefinition (the one based off of the instance db)owen
08/04/2023, 8:57 PMAlex Kan
08/07/2023, 5:53 PMPeter Lim
08/14/2023, 7:29 PM