apache-airflow-providers-dbt-cloud 3.8.0rc1__py3-none-any.whl → 3.8.1rc1__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.

@@ -25,14 +25,11 @@ from __future__ import annotations
25
25
 
26
26
  import packaging.version
27
27
 
28
- __all__ = ["__version__"]
28
+ from airflow import __version__ as airflow_version
29
29
 
30
- __version__ = "3.8.0"
30
+ __all__ = ["__version__"]
31
31
 
32
- try:
33
- from airflow import __version__ as airflow_version
34
- except ImportError:
35
- from airflow.version import version as airflow_version
32
+ __version__ = "3.8.1"
36
33
 
37
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
38
35
  "2.7.0"
@@ -28,8 +28,9 @@ def get_provider_info():
28
28
  "name": "dbt Cloud",
29
29
  "description": "`dbt Cloud <https://www.getdbt.com/product/dbt-cloud/>`__\n",
30
30
  "state": "ready",
31
- "source-date-epoch": 1714476223,
31
+ "source-date-epoch": 1716287366,
32
32
  "versions": [
33
+ "3.8.1",
33
34
  "3.8.0",
34
35
  "3.7.1",
35
36
  "3.7.0",
@@ -62,6 +63,13 @@ def get_provider_info():
62
63
  "asgiref",
63
64
  "aiohttp>=3.9.2",
64
65
  ],
66
+ "additional-extras": [
67
+ {
68
+ "name": "openlineage",
69
+ "description": "Install compatible OpenLineage dependencies",
70
+ "dependencies": ["apache-airflow-providers-openlineage>=1.7.0"],
71
+ }
72
+ ],
65
73
  "integrations": [
66
74
  {
67
75
  "integration-name": "dbt Cloud",
@@ -19,6 +19,7 @@ from __future__ import annotations
19
19
  import asyncio
20
20
  import json
21
21
  import time
22
+ import warnings
22
23
  from enum import Enum
23
24
  from functools import cached_property, wraps
24
25
  from inspect import signature
@@ -39,6 +40,8 @@ if TYPE_CHECKING:
39
40
 
40
41
  from airflow.models import Connection
41
42
 
43
+ DBT_CAUSE_MAX_LENGTH = 255
44
+
42
45
 
43
46
  def fallback_to_default_account(func: Callable) -> Callable:
44
47
  """
@@ -420,6 +423,15 @@ class DbtCloudHook(HttpHook):
420
423
  if additional_run_config is None:
421
424
  additional_run_config = {}
422
425
 
426
+ if cause is not None and len(cause) > DBT_CAUSE_MAX_LENGTH:
427
+ warnings.warn(
428
+ f"Cause `{cause}` exceeds limit of {DBT_CAUSE_MAX_LENGTH}"
429
+ f" characters and will be truncated.",
430
+ UserWarning,
431
+ stacklevel=2,
432
+ )
433
+ cause = cause[:DBT_CAUSE_MAX_LENGTH]
434
+
423
435
  payload = {
424
436
  "cause": cause,
425
437
  "steps_override": steps_override,
@@ -21,6 +21,8 @@ import re
21
21
  from contextlib import suppress
22
22
  from typing import TYPE_CHECKING
23
23
 
24
+ from airflow import __version__ as airflow_version
25
+
24
26
  if TYPE_CHECKING:
25
27
  from airflow.models.taskinstance import TaskInstance
26
28
  from airflow.providers.dbt.cloud.operators.dbt import DbtCloudRunJobOperator
@@ -28,6 +30,16 @@ if TYPE_CHECKING:
28
30
  from airflow.providers.openlineage.extractors.base import OperatorLineage
29
31
 
30
32
 
33
+ def _get_try_number(val):
34
+ # todo: remove when min airflow version >= 2.10.0
35
+ from packaging.version import parse
36
+
37
+ if parse(parse(airflow_version).base_version) < parse("2.10.0"):
38
+ return val.try_number - 1
39
+ else:
40
+ return val.try_number
41
+
42
+
31
43
  def generate_openlineage_events_from_dbt_cloud_run(
32
44
  operator: DbtCloudRunJobOperator | DbtCloudJobRunSensor, task_instance: TaskInstance
33
45
  ) -> OperatorLineage:
@@ -47,7 +59,14 @@ def generate_openlineage_events_from_dbt_cloud_run(
47
59
  """
48
60
  from openlineage.common.provider.dbt import DbtCloudArtifactProcessor, ParentRunMetadata
49
61
 
50
- from airflow.providers.openlineage.conf import namespace
62
+ try:
63
+ from airflow.providers.openlineage.conf import namespace
64
+ except ModuleNotFoundError as e:
65
+ from airflow.exceptions import AirflowOptionalProviderFeatureException
66
+
67
+ msg = "Please install `apache-airflow-providers-openlineage>=1.7.0`"
68
+ raise AirflowOptionalProviderFeatureException(e, msg)
69
+
51
70
  from airflow.providers.openlineage.extractors import OperatorLineage
52
71
  from airflow.providers.openlineage.plugins.adapter import (
53
72
  _PRODUCER,
@@ -124,7 +143,7 @@ def generate_openlineage_events_from_dbt_cloud_run(
124
143
  dag_id=task_instance.dag_id,
125
144
  task_id=operator.task_id,
126
145
  execution_date=task_instance.execution_date,
127
- try_number=task_instance.try_number - 1,
146
+ try_number=_get_try_number(task_instance),
128
147
  )
129
148
 
130
149
  parent_job = ParentRunMetadata(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-dbt-cloud
3
- Version: 3.8.0rc1
3
+ Version: 3.8.1rc1
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>
@@ -26,10 +26,10 @@ Requires-Dist: apache-airflow-providers-http
26
26
  Requires-Dist: apache-airflow>=2.7.0rc0
27
27
  Requires-Dist: asgiref
28
28
  Requires-Dist: apache-airflow-providers-http ; extra == "http"
29
- Requires-Dist: apache-airflow-providers-openlineage ; extra == "openlineage"
29
+ Requires-Dist: apache-airflow-providers-openlineage>=1.7.0rc0 ; extra == "openlineage"
30
30
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
31
- Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.8.0/changelog.html
32
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.8.0
31
+ Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.8.1/changelog.html
32
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.8.1
33
33
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
34
34
  Project-URL: Source Code, https://github.com/apache/airflow
35
35
  Project-URL: Twitter, https://twitter.com/ApacheAirflow
@@ -81,7 +81,7 @@ Provides-Extra: openlineage
81
81
 
82
82
  Package ``apache-airflow-providers-dbt-cloud``
83
83
 
84
- Release: ``3.8.0.rc1``
84
+ Release: ``3.8.1.rc1``
85
85
 
86
86
 
87
87
  `dbt Cloud <https://www.getdbt.com/product/dbt-cloud/>`__
@@ -94,7 +94,7 @@ This is a provider package for ``dbt.cloud`` provider. All classes for this prov
94
94
  are in ``airflow.providers.dbt.cloud`` python package.
95
95
 
96
96
  You can find package information and changelog for the provider
97
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.8.0/>`_.
97
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.8.1/>`_.
98
98
 
99
99
  Installation
100
100
  ------------
@@ -138,4 +138,4 @@ Dependent package
138
138
  ============================================================================================================== ===============
139
139
 
140
140
  The changelog for the provider package can be found in the
141
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.8.0/changelog.html>`_.
141
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.8.1/changelog.html>`_.
@@ -1,8 +1,8 @@
1
1
  airflow/providers/dbt/cloud/LICENSE,sha256=ywUBpKZc7Jb96rVt5I3IDbg7dIJAbUSHkuoDcF3jbH4,13569
2
- airflow/providers/dbt/cloud/__init__.py,sha256=DT9jyekBWhbypsfVRXU_S0MOw1olXQDGm97g2BmRucQ,1584
3
- airflow/providers/dbt/cloud/get_provider_info.py,sha256=RM3t64XWAmgADWrZKsRvq-RGwqnmfC1mCy8CODzO0xg,3329
2
+ airflow/providers/dbt/cloud/__init__.py,sha256=vwQJnG4ktwAPQDHDZs--H4co4vcGjqTNmD73G9nl8mA,1496
3
+ airflow/providers/dbt/cloud/get_provider_info.py,sha256=MiVkDAEHjbt6hHYkTMn10UVKyLMNE7ffO9dJtxcpfrI,3618
4
4
  airflow/providers/dbt/cloud/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
5
- airflow/providers/dbt/cloud/hooks/dbt.py,sha256=CleiIF1sfY7lY-r-5x3GzpWAciAHSNSy-A4ce4uMM2M,26284
5
+ airflow/providers/dbt/cloud/hooks/dbt.py,sha256=vRwNw-vhdGVERqFURHrASJd3OcmiC6EZNpmkV5zNl7g,26676
6
6
  airflow/providers/dbt/cloud/operators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
7
7
  airflow/providers/dbt/cloud/operators/dbt.py,sha256=7tNFqg4S9YYxvua8KE84keM3CM9UTcw-_m2lP7M_eYY,15634
8
8
  airflow/providers/dbt/cloud/sensors/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
@@ -10,8 +10,8 @@ airflow/providers/dbt/cloud/sensors/dbt.py,sha256=X8Q1YLj76qwj3nAy6a_aF4edID-oJW
10
10
  airflow/providers/dbt/cloud/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
11
11
  airflow/providers/dbt/cloud/triggers/dbt.py,sha256=pd7b6SF4IEQrZHb8xNIPHIsIbaKwom2h9eMUU-THMM4,4675
12
12
  airflow/providers/dbt/cloud/utils/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
13
- airflow/providers/dbt/cloud/utils/openlineage.py,sha256=mLqqhJfH9W_dn_XME0T1JORCtUX7I7LaCgPUHf8-hsc,5675
14
- apache_airflow_providers_dbt_cloud-3.8.0rc1.dist-info/entry_points.txt,sha256=c18L1WEEK18WQeEGrm9kMVqutiYJHiWGH5jU1JqnToE,105
15
- apache_airflow_providers_dbt_cloud-3.8.0rc1.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
16
- apache_airflow_providers_dbt_cloud-3.8.0rc1.dist-info/METADATA,sha256=_BPtwiMa5C4DCPRnYcALFg6fkktSjks6pkL_Iy5HB_g,6353
17
- apache_airflow_providers_dbt_cloud-3.8.0rc1.dist-info/RECORD,,
13
+ airflow/providers/dbt/cloud/utils/openlineage.py,sha256=tLHfM6L9cOy4ZvpnJFjJAI3qxAztn073GbLHsXpjvFQ,6265
14
+ apache_airflow_providers_dbt_cloud-3.8.1rc1.dist-info/entry_points.txt,sha256=c18L1WEEK18WQeEGrm9kMVqutiYJHiWGH5jU1JqnToE,105
15
+ apache_airflow_providers_dbt_cloud-3.8.1rc1.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
16
+ apache_airflow_providers_dbt_cloud-3.8.1rc1.dist-info/METADATA,sha256=JIHOQ4HJwP-z5EIwPSQR8YJmVNSa47znMGACbkOyY_E,6363
17
+ apache_airflow_providers_dbt_cloud-3.8.1rc1.dist-info/RECORD,,