Skip to content

Commit

Permalink
Do not use default object instance in dagster_dbt_translator argument…
Browse files Browse the repository at this point in the history
… of dbt_assets (#21351)

## Summary & Motivation

Similar to Similar to #21340 but for `dbt_assets`. Per https://docs.python-guide.org/writing/gotchas/ you should not set a default parameter to an object instance.

## How I Tested These Changes

BK
  • Loading branch information
schrockn authored Apr 23, 2024
1 parent a92dc1b commit a204825
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def dbt_assets(
name: Optional[str] = None,
io_manager_key: Optional[str] = None,
partitions_def: Optional[PartitionsDefinition] = None,
dagster_dbt_translator: DagsterDbtTranslator = DagsterDbtTranslator(),
dagster_dbt_translator: Optional[DagsterDbtTranslator] = None,
backfill_policy: Optional[BackfillPolicy] = None,
op_tags: Optional[Mapping[str, Any]] = None,
required_resource_keys: Optional[Set[str]] = None,
Expand Down Expand Up @@ -325,7 +325,7 @@ def partitionshop_dbt_assets(context: AssetExecutionContext, dbt: DbtCliResource
yield from dbt.cli(dbt_build_args, context=context).stream()
"""
dagster_dbt_translator = validate_translator(dagster_dbt_translator)
dagster_dbt_translator = validate_translator(dagster_dbt_translator or DagsterDbtTranslator())
manifest = validate_manifest(manifest)

unique_ids = select_unique_ids_from_manifest(
Expand Down

0 comments on commit a204825

Please sign in to comment.