dagster-dbt 0.28.9__py3-none-any.whl → 0.28.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dagster_dbt/asset_utils.py +51 -7
- dagster_dbt/version.py +1 -1
- {dagster_dbt-0.28.9.dist-info → dagster_dbt-0.28.11.dist-info}/METADATA +2 -2
- {dagster_dbt-0.28.9.dist-info → dagster_dbt-0.28.11.dist-info}/RECORD +8 -8
- {dagster_dbt-0.28.9.dist-info → dagster_dbt-0.28.11.dist-info}/WHEEL +0 -0
- {dagster_dbt-0.28.9.dist-info → dagster_dbt-0.28.11.dist-info}/entry_points.txt +0 -0
- {dagster_dbt-0.28.9.dist-info → dagster_dbt-0.28.11.dist-info}/licenses/LICENSE +0 -0
- {dagster_dbt-0.28.9.dist-info → dagster_dbt-0.28.11.dist-info}/top_level.txt +0 -0
dagster_dbt/asset_utils.py
CHANGED
|
@@ -63,6 +63,42 @@ DBT_EMPTY_INDIRECT_SELECTION: Final[str] = "empty"
|
|
|
63
63
|
# https://github.com/dagster-io/dagster/issues/16997
|
|
64
64
|
_SELECTION_ARGS_THRESHOLD: Final[int] = 200
|
|
65
65
|
|
|
66
|
+
|
|
67
|
+
def _parse_selection_args(
|
|
68
|
+
selection_args: list[str],
|
|
69
|
+
) -> tuple[Optional[list[str]], Optional[list[str]]]:
|
|
70
|
+
"""Parse selection args into separate select and exclude resource lists.
|
|
71
|
+
|
|
72
|
+
This function is designed for dagster-dbt's internal argument format, where select/exclude
|
|
73
|
+
values are passed as a single space-separated string (e.g., ["--select", "model1 model2"]).
|
|
74
|
+
This matches how dagster-dbt constructs these arguments in get_subset_selection_for_context.
|
|
75
|
+
It does not handle the dbt CLI's alternative format of multiple --select flags.
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
selection_args: CLI arguments in dagster-dbt's internal format,
|
|
79
|
+
e.g., ["--select", "model1 model2", "--exclude", "model3"]
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
Tuple of (select_resources, exclude_resources) where each is a list of resource names
|
|
83
|
+
or None if not present.
|
|
84
|
+
"""
|
|
85
|
+
select_resources: Optional[list[str]] = None
|
|
86
|
+
exclude_resources: Optional[list[str]] = None
|
|
87
|
+
|
|
88
|
+
i = 0
|
|
89
|
+
while i < len(selection_args):
|
|
90
|
+
if selection_args[i] == "--select" and i + 1 < len(selection_args):
|
|
91
|
+
select_resources = selection_args[i + 1].split(" ")
|
|
92
|
+
i += 2
|
|
93
|
+
elif selection_args[i] == "--exclude" and i + 1 < len(selection_args):
|
|
94
|
+
exclude_resources = selection_args[i + 1].split(" ")
|
|
95
|
+
i += 2
|
|
96
|
+
else:
|
|
97
|
+
i += 1
|
|
98
|
+
|
|
99
|
+
return select_resources, exclude_resources
|
|
100
|
+
|
|
101
|
+
|
|
66
102
|
DUPLICATE_ASSET_KEY_ERROR_MESSAGE = (
|
|
67
103
|
"The following dbt resources are configured with identical Dagster asset keys."
|
|
68
104
|
" Please ensure that each dbt resource generates a unique Dagster asset key."
|
|
@@ -464,11 +500,11 @@ def get_updated_cli_invocation_params_for_context(
|
|
|
464
500
|
dagster_dbt_translator=dagster_dbt_translator,
|
|
465
501
|
current_dbt_indirect_selection_env=indirect_selection,
|
|
466
502
|
)
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
503
|
+
# Parse selection args to get select and exclude resources
|
|
504
|
+
select_resources, exclude_resources = _parse_selection_args(selection_args)
|
|
505
|
+
total_resources = len(select_resources or []) + len(exclude_resources or [])
|
|
506
|
+
|
|
507
|
+
if select_resources and project_dir and total_resources > _SELECTION_ARGS_THRESHOLD:
|
|
472
508
|
temp_project_dir = tempfile.mkdtemp()
|
|
473
509
|
shutil.copytree(project_dir, temp_project_dir, dirs_exist_ok=True)
|
|
474
510
|
selectors_path = Path(temp_project_dir) / "selectors.yml"
|
|
@@ -478,17 +514,25 @@ def get_updated_cli_invocation_params_for_context(
|
|
|
478
514
|
selectors_path.unlink()
|
|
479
515
|
|
|
480
516
|
selector_name = f"dagster_run_{context.run_id}"
|
|
517
|
+
# Build selector definition with union of selected resources
|
|
518
|
+
# and optional exclude section nested inside the union
|
|
519
|
+
# See: https://docs.getdbt.com/reference/node-selection/yaml-selectors
|
|
520
|
+
# Note: exclude must be nested inside the union array, not a sibling key
|
|
521
|
+
union_items: list[Any] = list(select_resources)
|
|
522
|
+
if exclude_resources:
|
|
523
|
+
union_items.append({"exclude": list(exclude_resources)})
|
|
524
|
+
|
|
481
525
|
temp_selectors = {
|
|
482
526
|
"selectors": [
|
|
483
527
|
{
|
|
484
528
|
"name": selector_name,
|
|
485
|
-
"definition": {"union":
|
|
529
|
+
"definition": {"union": union_items},
|
|
486
530
|
}
|
|
487
531
|
]
|
|
488
532
|
}
|
|
489
533
|
selectors_path.write_text(yaml.safe_dump(temp_selectors))
|
|
490
534
|
logger.info(
|
|
491
|
-
f"DBT selection of {
|
|
535
|
+
f"DBT selection of {total_resources} resources exceeds threshold of {_SELECTION_ARGS_THRESHOLD}. "
|
|
492
536
|
"This may exceed system argument length limits. "
|
|
493
537
|
f"Executing materialization against temporary copy of DBT project at {temp_project_dir} with ephemeral selector."
|
|
494
538
|
)
|
dagster_dbt/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.28.
|
|
1
|
+
__version__ = "0.28.11"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dagster-dbt
|
|
3
|
-
Version: 0.28.
|
|
3
|
+
Version: 0.28.11
|
|
4
4
|
Summary: A Dagster integration for dbt
|
|
5
5
|
Home-page: https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-dbt
|
|
6
6
|
Author: Dagster Labs
|
|
@@ -15,7 +15,7 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
15
15
|
Classifier: Operating System :: OS Independent
|
|
16
16
|
Requires-Python: >=3.10,<3.14
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: dagster==1.12.
|
|
18
|
+
Requires-Dist: dagster==1.12.11
|
|
19
19
|
Requires-Dist: dbt-core<1.12,>=1.7
|
|
20
20
|
Requires-Dist: gitpython
|
|
21
21
|
Requires-Dist: Jinja2
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
dagster_dbt/__init__.py,sha256=rlPCxCzovXNDiqXBUEcgNVHjZrXQXwcX3kwUhe_69C4,4708
|
|
2
2
|
dagster_dbt/asset_decorator.py,sha256=OFFjhmDQO6dK8N3U7VQF7gergswkIS3eHnMRwAe2BZY,14892
|
|
3
3
|
dagster_dbt/asset_specs.py,sha256=2EdWIhY2QZhtGXM7N-kkkeK3ClnGgYX7ayRi_X11cLg,2741
|
|
4
|
-
dagster_dbt/asset_utils.py,sha256=
|
|
4
|
+
dagster_dbt/asset_utils.py,sha256=ZwMtMS_G_AyTmsFIaRGaoW9gH8aT6D6yChXiKr948xA,48821
|
|
5
5
|
dagster_dbt/compat.py,sha256=lqzGonzQE7Lb825yRqUaQPXeNQp8umAR4LqyD6COXdc,3609
|
|
6
6
|
dagster_dbt/dagster_dbt_translator.py,sha256=HnXtw9UgUMrrPDUrJ8__kMtOrYDHVz4jCBVXl_VbdHM,30834
|
|
7
7
|
dagster_dbt/dbt_core_version.py,sha256=Xbygc8qrDnhUhicD0KRRry6YRi3W5ztB2VxKmcxPXeA,38
|
|
@@ -15,7 +15,7 @@ dagster_dbt/freshness_builder.py,sha256=DHAC3AGWAwIA7psDf72R0t5p8NjxDytGU9g5xnca
|
|
|
15
15
|
dagster_dbt/metadata_set.py,sha256=lqjASYoYeM_Ey6r8UsPUkRMwmuAIfFCFvkNm0xW5xTg,512
|
|
16
16
|
dagster_dbt/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
|
|
17
17
|
dagster_dbt/utils.py,sha256=gT6xO7buRolkhc2fa5ySUPfD1eXo3e6RJWZAKkM6yFo,8513
|
|
18
|
-
dagster_dbt/version.py,sha256=
|
|
18
|
+
dagster_dbt/version.py,sha256=MlSqB7SmZ8R1F0K_PtG4rMWRGGllC7hEsX-reHAF_8A,24
|
|
19
19
|
dagster_dbt/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
dagster_dbt/cli/app.py,sha256=9oBx85uzAkMtBdV39vNm5rxuAGPVYzzDUs6Ek-KL0XY,13516
|
|
21
21
|
dagster_dbt/cloud/__init__.py,sha256=8WKaLuPl_pUG9Cv78GW782vrWQfqK8QtAWegkTxA9r4,441
|
|
@@ -51,9 +51,9 @@ dagster_dbt/include/scaffold/assets.py.jinja,sha256=JImqnDUP5ewy8RVti4IuXL70yJno
|
|
|
51
51
|
dagster_dbt/include/scaffold/definitions.py.jinja,sha256=Hou7emwkEeh5YXTdqjYFrAc2SK-Q6MgTNsQOKA_Vy3s,364
|
|
52
52
|
dagster_dbt/include/scaffold/project.py.jinja,sha256=YNtkT5Hq4VbGw-b7QcxdelhXsesIKORwVuBFGFdfeUs,432
|
|
53
53
|
dagster_dbt/include/scaffold/schedules.py.jinja,sha256=Xua_VtPjYFc498A5uaBGQ36GwV1gqciO4P3D8Yt9M-Y,413
|
|
54
|
-
dagster_dbt-0.28.
|
|
55
|
-
dagster_dbt-0.28.
|
|
56
|
-
dagster_dbt-0.28.
|
|
57
|
-
dagster_dbt-0.28.
|
|
58
|
-
dagster_dbt-0.28.
|
|
59
|
-
dagster_dbt-0.28.
|
|
54
|
+
dagster_dbt-0.28.11.dist-info/licenses/LICENSE,sha256=4lsMW-RCvfVD4_F57wrmpe3vX1xwUk_OAKKmV_XT7Z0,11348
|
|
55
|
+
dagster_dbt-0.28.11.dist-info/METADATA,sha256=1Zr-lXJ1nOV1SGPi1dYjpRUmSgH1ifhv9JDkY9GR0Q0,1632
|
|
56
|
+
dagster_dbt-0.28.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
57
|
+
dagster_dbt-0.28.11.dist-info/entry_points.txt,sha256=pbv0tVoTB7cByG-noE8rC6atvthh64qBaTo7PkQ9HbM,163
|
|
58
|
+
dagster_dbt-0.28.11.dist-info/top_level.txt,sha256=hoOwFvw9OpJUN1azE6UVHcxMKqhUwR_BTN0Ay-iKUDA,12
|
|
59
|
+
dagster_dbt-0.28.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|