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

@@ -215,7 +215,7 @@ Third party Apache 2.0 licenses
215
215
 
216
216
  The following components are provided under the Apache 2.0 License.
217
217
  See project link for details. The text of each license is also included
218
- at licenses/LICENSE-[project].txt.
218
+ at 3rd-party-licenses/LICENSE-[project].txt.
219
219
 
220
220
  (ALv2 License) hue v4.3.0 (https://github.com/cloudera/hue/)
221
221
  (ALv2 License) jqclock v2.3.0 (https://github.com/JohnRDOrazio/jQuery-Clock-Plugin)
@@ -227,7 +227,7 @@ MIT licenses
227
227
  ========================================================================
228
228
 
229
229
  The following components are provided under the MIT License. See project link for details.
230
- The text of each license is also included at licenses/LICENSE-[project].txt.
230
+ The text of each license is also included at 3rd-party-licenses/LICENSE-[project].txt.
231
231
 
232
232
  (MIT License) jquery v3.5.1 (https://jquery.org/license/)
233
233
  (MIT License) dagre-d3 v0.6.4 (https://github.com/cpettitt/dagre-d3)
@@ -243,11 +243,11 @@ The text of each license is also included at licenses/LICENSE-[project].txt.
243
243
  BSD 3-Clause licenses
244
244
  ========================================================================
245
245
  The following components are provided under the BSD 3-Clause license. See project links for details.
246
- The text of each license is also included at licenses/LICENSE-[project].txt.
246
+ The text of each license is also included at 3rd-party-licenses/LICENSE-[project].txt.
247
247
 
248
248
  (BSD 3 License) d3 v5.16.0 (https://d3js.org)
249
249
  (BSD 3 License) d3-shape v2.1.0 (https://github.com/d3/d3-shape)
250
250
  (BSD 3 License) cgroupspy 0.2.1 (https://github.com/cloudsigma/cgroupspy)
251
251
 
252
252
  ========================================================================
253
- See licenses/LICENSES-ui.txt for packages used in `/airflow/www`
253
+ See 3rd-party-licenses/LICENSES-ui.txt for packages used in `/airflow/www`
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "3.8.1"
32
+ __version__ = "3.9.0"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
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": 1716287366,
31
+ "source-date-epoch": 1718604259,
32
32
  "versions": [
33
+ "3.9.0",
33
34
  "3.8.1",
34
35
  "3.8.0",
35
36
  "3.7.1",
@@ -404,6 +404,7 @@ class DbtCloudHook(HttpHook):
404
404
  account_id: int | None = None,
405
405
  steps_override: list[str] | None = None,
406
406
  schema_override: str | None = None,
407
+ retry_from_failure: bool = False,
407
408
  additional_run_config: dict[str, Any] | None = None,
408
409
  ) -> Response:
409
410
  """
@@ -416,6 +417,9 @@ class DbtCloudHook(HttpHook):
416
417
  instead of those configured in dbt Cloud.
417
418
  :param schema_override: Optional. Override the destination schema in the configured target for this
418
419
  job.
420
+ :param retry_from_failure: Optional. If set to True and the previous job run has failed, the job
421
+ will be triggered using the "rerun" endpoint. This parameter cannot be used alongside
422
+ steps_override, schema_override, or additional_run_config.
419
423
  :param additional_run_config: Optional. Any additional parameters that should be included in the API
420
424
  request when triggering the job.
421
425
  :return: The request response.
@@ -439,6 +443,24 @@ class DbtCloudHook(HttpHook):
439
443
  }
440
444
  payload.update(additional_run_config)
441
445
 
446
+ if retry_from_failure:
447
+ latest_run = self.get_job_runs(
448
+ account_id=account_id,
449
+ payload={
450
+ "job_definition_id": job_id,
451
+ "order_by": "-created_at",
452
+ "limit": 1,
453
+ },
454
+ ).json()["data"]
455
+ if latest_run and latest_run[0]["status"] == DbtCloudJobRunStatus.ERROR.value:
456
+ if steps_override is not None or schema_override is not None or additional_run_config != {}:
457
+ warnings.warn(
458
+ "steps_override, schema_override, or additional_run_config will be ignored when"
459
+ " retry_from_failure is True and previous job run has failed.",
460
+ UserWarning,
461
+ stacklevel=2,
462
+ )
463
+ return self.retry_failed_job_run(job_id, account_id)
442
464
  return self._run_and_get_response(
443
465
  method="POST",
444
466
  endpoint=f"{account_id}/jobs/{job_id}/run/",
@@ -662,6 +684,17 @@ class DbtCloudHook(HttpHook):
662
684
  results = await asyncio.gather(*tasks.values())
663
685
  return {filename: result.json() for filename, result in zip(tasks.keys(), results)}
664
686
 
687
+ @fallback_to_default_account
688
+ def retry_failed_job_run(self, job_id: int, account_id: int | None = None) -> Response:
689
+ """
690
+ Retry a failed run for a job from the point of failure, if the run failed. Otherwise, trigger a new run.
691
+
692
+ :param job_id: The ID of a dbt Cloud job.
693
+ :param account_id: Optional. The ID of a dbt Cloud account.
694
+ :return: The request response.
695
+ """
696
+ return self._run_and_get_response(method="POST", endpoint=f"{account_id}/jobs/{job_id}/rerun/")
697
+
665
698
  def test_connection(self) -> tuple[bool, str]:
666
699
  """Test dbt Cloud connection."""
667
700
  try:
@@ -75,6 +75,10 @@ class DbtCloudRunJobOperator(BaseOperator):
75
75
  request when triggering the job.
76
76
  :param reuse_existing_run: Flag to determine whether to reuse existing non terminal job run. If set to
77
77
  true and non terminal job runs found, it use the latest run without triggering a new job run.
78
+ :param retry_from_failure: Flag to determine whether to retry the job run from failure. If set to true
79
+ and the last job run has failed, it triggers a new job run with the same configuration as the failed
80
+ run. For more information on retry logic, see:
81
+ https://docs.getdbt.com/dbt-cloud/api-v2#/operations/Retry%20Failed%20Job
78
82
  :param deferrable: Run operator in the deferrable mode
79
83
  :return: The ID of the triggered dbt Cloud job run.
80
84
  """
@@ -105,6 +109,7 @@ class DbtCloudRunJobOperator(BaseOperator):
105
109
  check_interval: int = 60,
106
110
  additional_run_config: dict[str, Any] | None = None,
107
111
  reuse_existing_run: bool = False,
112
+ retry_from_failure: bool = False,
108
113
  deferrable: bool = conf.getboolean("operators", "default_deferrable", fallback=False),
109
114
  **kwargs,
110
115
  ) -> None:
@@ -121,6 +126,7 @@ class DbtCloudRunJobOperator(BaseOperator):
121
126
  self.additional_run_config = additional_run_config or {}
122
127
  self.run_id: int | None = None
123
128
  self.reuse_existing_run = reuse_existing_run
129
+ self.retry_from_failure = retry_from_failure
124
130
  self.deferrable = deferrable
125
131
 
126
132
  def execute(self, context: Context):
@@ -135,7 +141,7 @@ class DbtCloudRunJobOperator(BaseOperator):
135
141
  account_id=self.account_id,
136
142
  payload={
137
143
  "job_definition_id": self.job_id,
138
- "status__in": DbtCloudJobRunStatus.NON_TERMINAL_STATUSES,
144
+ "status__in": str(list(DbtCloudJobRunStatus.NON_TERMINAL_STATUSES.value)),
139
145
  "order_by": "-created_at",
140
146
  },
141
147
  ).json()["data"]
@@ -150,6 +156,7 @@ class DbtCloudRunJobOperator(BaseOperator):
150
156
  cause=self.trigger_reason,
151
157
  steps_override=self.steps_override,
152
158
  schema_override=self.schema_override,
159
+ retry_from_failure=self.retry_from_failure,
153
160
  additional_run_config=self.additional_run_config,
154
161
  )
155
162
  self.run_id = trigger_job_response.json()["data"]["id"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-dbt-cloud
3
- Version: 3.8.1rc1
3
+ Version: 3.9.0
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>
@@ -23,13 +23,13 @@ Classifier: Programming Language :: Python :: 3.12
23
23
  Classifier: Topic :: System :: Monitoring
24
24
  Requires-Dist: aiohttp>=3.9.2
25
25
  Requires-Dist: apache-airflow-providers-http
26
- Requires-Dist: apache-airflow>=2.7.0rc0
26
+ Requires-Dist: apache-airflow>=2.7.0
27
27
  Requires-Dist: asgiref
28
28
  Requires-Dist: apache-airflow-providers-http ; extra == "http"
29
- Requires-Dist: apache-airflow-providers-openlineage>=1.7.0rc0 ; extra == "openlineage"
29
+ Requires-Dist: apache-airflow-providers-openlineage>=1.7.0 ; 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.1/changelog.html
32
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.8.1
31
+ Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.9.0/changelog.html
32
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.9.0
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.1.rc1``
84
+ Release: ``3.9.0``
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.1/>`_.
97
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.9.0/>`_.
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.1/changelog.html>`_.
141
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.9.0/changelog.html>`_.
@@ -0,0 +1,17 @@
1
+ airflow/providers/dbt/cloud/LICENSE,sha256=FFb4jd2AXnOOf7XLP04pQW6jbdhG49TxlGY6fFpCV1Y,13609
2
+ airflow/providers/dbt/cloud/__init__.py,sha256=tEh82IZ-5dQHsSHWdTKuBee71c-fZ9ew2zmxakHfknQ,1496
3
+ airflow/providers/dbt/cloud/get_provider_info.py,sha256=saJSB2KMEvY8Aknnrg6kAF5_Zz-KNh_jGv3FQaYrb_8,3639
4
+ airflow/providers/dbt/cloud/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
5
+ airflow/providers/dbt/cloud/hooks/dbt.py,sha256=EX_0CP-jL1F-j0syrpcM8vvIdXELGGu3LyGj3yOxpx8,28427
6
+ airflow/providers/dbt/cloud/operators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
7
+ airflow/providers/dbt/cloud/operators/dbt.py,sha256=jgdk-Ve8YKYy5Twz9lq74iQpElEI_mS1IwASmCqPDQY,16159
8
+ airflow/providers/dbt/cloud/sensors/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
9
+ airflow/providers/dbt/cloud/sensors/dbt.py,sha256=X8Q1YLj76qwj3nAy6a_aF4edID-oJWMfFLVSrrQMZ1k,6860
10
+ airflow/providers/dbt/cloud/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
11
+ airflow/providers/dbt/cloud/triggers/dbt.py,sha256=pd7b6SF4IEQrZHb8xNIPHIsIbaKwom2h9eMUU-THMM4,4675
12
+ airflow/providers/dbt/cloud/utils/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
13
+ airflow/providers/dbt/cloud/utils/openlineage.py,sha256=tLHfM6L9cOy4ZvpnJFjJAI3qxAztn073GbLHsXpjvFQ,6265
14
+ apache_airflow_providers_dbt_cloud-3.9.0.dist-info/entry_points.txt,sha256=c18L1WEEK18WQeEGrm9kMVqutiYJHiWGH5jU1JqnToE,105
15
+ apache_airflow_providers_dbt_cloud-3.9.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
16
+ apache_airflow_providers_dbt_cloud-3.9.0.dist-info/METADATA,sha256=1cFZuNhaZ56SS6iC-xobHueaKbzirObvifYOqP4vxcE,6350
17
+ apache_airflow_providers_dbt_cloud-3.9.0.dist-info/RECORD,,
@@ -1,17 +0,0 @@
1
- airflow/providers/dbt/cloud/LICENSE,sha256=ywUBpKZc7Jb96rVt5I3IDbg7dIJAbUSHkuoDcF3jbH4,13569
2
- airflow/providers/dbt/cloud/__init__.py,sha256=vwQJnG4ktwAPQDHDZs--H4co4vcGjqTNmD73G9nl8mA,1496
3
- airflow/providers/dbt/cloud/get_provider_info.py,sha256=MiVkDAEHjbt6hHYkTMn10UVKyLMNE7ffO9dJtxcpfrI,3618
4
- airflow/providers/dbt/cloud/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
5
- airflow/providers/dbt/cloud/hooks/dbt.py,sha256=vRwNw-vhdGVERqFURHrASJd3OcmiC6EZNpmkV5zNl7g,26676
6
- airflow/providers/dbt/cloud/operators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
7
- airflow/providers/dbt/cloud/operators/dbt.py,sha256=7tNFqg4S9YYxvua8KE84keM3CM9UTcw-_m2lP7M_eYY,15634
8
- airflow/providers/dbt/cloud/sensors/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
9
- airflow/providers/dbt/cloud/sensors/dbt.py,sha256=X8Q1YLj76qwj3nAy6a_aF4edID-oJWMfFLVSrrQMZ1k,6860
10
- airflow/providers/dbt/cloud/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
11
- airflow/providers/dbt/cloud/triggers/dbt.py,sha256=pd7b6SF4IEQrZHb8xNIPHIsIbaKwom2h9eMUU-THMM4,4675
12
- airflow/providers/dbt/cloud/utils/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
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,,