apache-airflow-providers-dbt-cloud 4.3.3__py3-none-any.whl → 4.4.0rc1__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.

Potentially problematic release.


This version of apache-airflow-providers-dbt-cloud might be problematic. Click here for more details.

@@ -29,11 +29,11 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "4.3.3"
32
+ __version__ = "4.4.0"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
- "2.9.0"
35
+ "2.10.0"
36
36
  ):
37
37
  raise RuntimeError(
38
- f"The package `apache-airflow-providers-dbt-cloud:{__version__}` needs Apache Airflow 2.9.0+"
38
+ f"The package `apache-airflow-providers-dbt-cloud:{__version__}` needs Apache Airflow 2.10.0+"
39
39
  )
@@ -22,7 +22,7 @@ import re
22
22
  from typing import TYPE_CHECKING
23
23
 
24
24
  from airflow.providers.common.compat.openlineage.check import require_openlineage_version
25
- from airflow.providers.dbt.cloud.version_compat import AIRFLOW_V_2_10_PLUS, AIRFLOW_V_3_0_PLUS
25
+ from airflow.providers.dbt.cloud.version_compat import AIRFLOW_V_3_0_PLUS
26
26
 
27
27
  if TYPE_CHECKING:
28
28
  from airflow.models.taskinstance import TaskInstance
@@ -48,14 +48,15 @@ def _get_logical_date(task_instance):
48
48
  return date
49
49
 
50
50
 
51
- def _get_try_number(val):
52
- # todo: remove when min airflow version >= 2.10.0
53
- if AIRFLOW_V_2_10_PLUS:
54
- return val.try_number
55
- return val.try_number - 1
51
+ def _get_dag_run_clear_number(task_instance):
52
+ # todo: remove when min airflow version >= 3.0
53
+ if AIRFLOW_V_3_0_PLUS:
54
+ dagrun = task_instance.get_template_context()["dag_run"]
55
+ return dagrun.clear_number
56
+ return task_instance.dag_run.clear_number
56
57
 
57
58
 
58
- @require_openlineage_version(provider_min_version="2.0.0")
59
+ @require_openlineage_version(provider_min_version="2.3.0")
59
60
  def generate_openlineage_events_from_dbt_cloud_run(
60
61
  operator: DbtCloudRunJobOperator | DbtCloudJobRunSensor, task_instance: TaskInstance
61
62
  ) -> OperatorLineage:
@@ -144,16 +145,25 @@ def generate_openlineage_events_from_dbt_cloud_run(
144
145
  dag_id=task_instance.dag_id,
145
146
  task_id=operator.task_id,
146
147
  logical_date=_get_logical_date(task_instance),
147
- try_number=_get_try_number(task_instance),
148
+ try_number=task_instance.try_number,
148
149
  map_index=task_instance.map_index,
149
150
  )
150
151
 
152
+ root_parent_run_id = OpenLineageAdapter.build_dag_run_id(
153
+ dag_id=task_instance.dag_id,
154
+ logical_date=_get_logical_date(task_instance),
155
+ clear_number=_get_dag_run_clear_number(task_instance),
156
+ )
157
+
151
158
  parent_job = ParentRunMetadata(
152
159
  run_id=parent_run_id,
153
160
  job_name=f"{task_instance.dag_id}.{task_instance.task_id}",
154
161
  job_namespace=namespace(),
162
+ root_parent_run_id=root_parent_run_id,
163
+ root_parent_job_name=task_instance.dag_id,
164
+ root_parent_job_namespace=namespace(),
155
165
  )
156
- client = get_openlineage_listener().adapter.get_or_create_openlineage_client()
166
+ adapter = get_openlineage_listener().adapter
157
167
 
158
168
  # process each step in loop, sending generated events in the same order as steps
159
169
  for counter, artifacts in enumerate(step_artifacts, 1):
@@ -183,7 +193,7 @@ def generate_openlineage_events_from_dbt_cloud_run(
183
193
  log.debug("Found %s OpenLineage events for artifact no. %s.", len(events), counter)
184
194
 
185
195
  for event in events:
186
- client.emit(event=event)
196
+ adapter.emit(event=event)
187
197
  log.debug("Emitted all OpenLineage events for artifact no. %s.", counter)
188
198
 
189
199
  log.info("OpenLineage has successfully finished processing information about DBT job run.")
@@ -32,5 +32,4 @@ def get_base_airflow_version_tuple() -> tuple[int, int, int]:
32
32
  return airflow_version.major, airflow_version.minor, airflow_version.micro
33
33
 
34
34
 
35
- AIRFLOW_V_2_10_PLUS = get_base_airflow_version_tuple() >= (2, 10, 0)
36
35
  AIRFLOW_V_3_0_PLUS = get_base_airflow_version_tuple() >= (3, 0, 0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apache-airflow-providers-dbt-cloud
3
- Version: 4.3.3
3
+ Version: 4.4.0rc1
4
4
  Summary: Provider package apache-airflow-providers-dbt-cloud for Apache Airflow
5
5
  Keywords: airflow-provider,dbt.cloud,airflow,integration
6
6
  Author-email: Apache Software Foundation <dev@airflow.apache.org>
@@ -20,15 +20,15 @@ Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Topic :: System :: Monitoring
23
- Requires-Dist: apache-airflow>=2.9.0
24
- Requires-Dist: apache-airflow-providers-common-compat>=1.6.0
23
+ Requires-Dist: apache-airflow>=2.10.0rc1
24
+ Requires-Dist: apache-airflow-providers-common-compat>=1.6.0rc1
25
25
  Requires-Dist: apache-airflow-providers-http
26
26
  Requires-Dist: asgiref>=2.3.0
27
27
  Requires-Dist: aiohttp>=3.9.2
28
- Requires-Dist: apache-airflow-providers-openlineage>=2.0.0 ; extra == "openlineage"
28
+ Requires-Dist: apache-airflow-providers-openlineage>=2.3.0rc1 ; extra == "openlineage"
29
29
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
30
- Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/4.3.3/changelog.html
31
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/4.3.3
30
+ Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-dbt-cloud/4.4.0/changelog.html
31
+ Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-dbt-cloud/4.4.0
32
32
  Project-URL: Mastodon, https://fosstodon.org/@airflow
33
33
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
34
34
  Project-URL: Source Code, https://github.com/apache/airflow
@@ -60,7 +60,7 @@ Provides-Extra: openlineage
60
60
 
61
61
  Package ``apache-airflow-providers-dbt-cloud``
62
62
 
63
- Release: ``4.3.3``
63
+ Release: ``4.4.0``
64
64
 
65
65
 
66
66
  `dbt Cloud <https://www.getdbt.com/product/dbt-cloud/>`__
@@ -73,7 +73,7 @@ This is a provider package for ``dbt.cloud`` provider. All classes for this prov
73
73
  are in ``airflow.providers.dbt.cloud`` python package.
74
74
 
75
75
  You can find package information and changelog for the provider
76
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/4.3.3/>`_.
76
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/4.4.0/>`_.
77
77
 
78
78
  Installation
79
79
  ------------
@@ -90,7 +90,7 @@ Requirements
90
90
  ========================================== ==================
91
91
  PIP package Version required
92
92
  ========================================== ==================
93
- ``apache-airflow`` ``>=2.9.0``
93
+ ``apache-airflow`` ``>=2.10.0``
94
94
  ``apache-airflow-providers-common-compat`` ``>=1.6.0``
95
95
  ``apache-airflow-providers-http``
96
96
  ``asgiref`` ``>=2.3.0``
@@ -119,5 +119,5 @@ Dependent package
119
119
  ================================================================================================================== =================
120
120
 
121
121
  The changelog for the provider package can be found in the
122
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/4.3.3/changelog.html>`_.
122
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/4.4.0/changelog.html>`_.
123
123
 
@@ -1,7 +1,7 @@
1
1
  airflow/providers/dbt/cloud/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
2
- airflow/providers/dbt/cloud/__init__.py,sha256=zm4_99zeTCViXmZk84_89WFvxxxy375Uw6zX48lzMgo,1496
2
+ airflow/providers/dbt/cloud/__init__.py,sha256=lNNmuCI6hZ8UIKQx7Lu8MoUk8SVTifn510qgSIcbgCw,1498
3
3
  airflow/providers/dbt/cloud/get_provider_info.py,sha256=ufODYanp90_NPW1UftzGIwwG65Olb5l5PfSp0Mo1SOs,2507
4
- airflow/providers/dbt/cloud/version_compat.py,sha256=aHg90_DtgoSnQvILFICexMyNlHlALBdaeWqkX3dFDug,1605
4
+ airflow/providers/dbt/cloud/version_compat.py,sha256=j5PCtXvZ71aBjixu-EFTNtVDPsngzzs7os0ZQDgFVDk,1536
5
5
  airflow/providers/dbt/cloud/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
6
6
  airflow/providers/dbt/cloud/hooks/dbt.py,sha256=jGE_QOeYhJvl11xV9zQ3Jq6xApOQrKovbZS9smCT9bI,34538
7
7
  airflow/providers/dbt/cloud/operators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
@@ -11,8 +11,8 @@ airflow/providers/dbt/cloud/sensors/dbt.py,sha256=OGf-VNKcCNCrImrdE8PudmtDak_MKJ
11
11
  airflow/providers/dbt/cloud/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
12
12
  airflow/providers/dbt/cloud/triggers/dbt.py,sha256=Oabdc7FcNhCQxkjDC5SqAiYEw4hSZ9mQGZgSt36a1E0,4707
13
13
  airflow/providers/dbt/cloud/utils/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
14
- airflow/providers/dbt/cloud/utils/openlineage.py,sha256=DZdvi1i4dDhWc9zqj-vf7E4gtDuoS68w3EwIPOxwnuw,7647
15
- apache_airflow_providers_dbt_cloud-4.3.3.dist-info/entry_points.txt,sha256=c18L1WEEK18WQeEGrm9kMVqutiYJHiWGH5jU1JqnToE,105
16
- apache_airflow_providers_dbt_cloud-4.3.3.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
17
- apache_airflow_providers_dbt_cloud-4.3.3.dist-info/METADATA,sha256=QfdSy5G59I7iDpMj9uhO90-4qmpsVbvoFWiv6yBgsY8,5758
18
- apache_airflow_providers_dbt_cloud-4.3.3.dist-info/RECORD,,
14
+ airflow/providers/dbt/cloud/utils/openlineage.py,sha256=mA0EusjqzHgF3NrHRyWGpWJ3ZGtflXU6Q1l39qhJREQ,8058
15
+ apache_airflow_providers_dbt_cloud-4.4.0rc1.dist-info/entry_points.txt,sha256=c18L1WEEK18WQeEGrm9kMVqutiYJHiWGH5jU1JqnToE,105
16
+ apache_airflow_providers_dbt_cloud-4.4.0rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
17
+ apache_airflow_providers_dbt_cloud-4.4.0rc1.dist-info/METADATA,sha256=TH1NhhNip68O3A4B_20OTbjj9GeKvqf6YyZqX04uFDM,5786
18
+ apache_airflow_providers_dbt_cloud-4.4.0rc1.dist-info/RECORD,,