apache-airflow-providers-dbt-cloud 3.10.1rc1__py3-none-any.whl → 3.11.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.
- airflow/providers/dbt/cloud/__init__.py +1 -1
- airflow/providers/dbt/cloud/get_provider_info.py +2 -1
- airflow/providers/dbt/cloud/hooks/dbt.py +30 -14
- {apache_airflow_providers_dbt_cloud-3.10.1rc1.dist-info → apache_airflow_providers_dbt_cloud-3.11.0rc1.dist-info}/METADATA +8 -9
- {apache_airflow_providers_dbt_cloud-3.10.1rc1.dist-info → apache_airflow_providers_dbt_cloud-3.11.0rc1.dist-info}/RECORD +7 -7
- {apache_airflow_providers_dbt_cloud-3.10.1rc1.dist-info → apache_airflow_providers_dbt_cloud-3.11.0rc1.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_dbt_cloud-3.10.1rc1.dist-info → apache_airflow_providers_dbt_cloud-3.11.0rc1.dist-info}/entry_points.txt +0 -0
|
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
|
|
|
29
29
|
|
|
30
30
|
__all__ = ["__version__"]
|
|
31
31
|
|
|
32
|
-
__version__ = "3.
|
|
32
|
+
__version__ = "3.11.0"
|
|
33
33
|
|
|
34
34
|
if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
|
|
35
35
|
"2.8.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":
|
|
31
|
+
"source-date-epoch": 1728485039,
|
|
32
32
|
"versions": [
|
|
33
|
+
"3.11.0",
|
|
33
34
|
"3.10.1",
|
|
34
35
|
"3.10.0",
|
|
35
36
|
"3.9.0",
|
|
@@ -26,7 +26,6 @@ from inspect import signature
|
|
|
26
26
|
from typing import TYPE_CHECKING, Any, Callable, Sequence, Set, TypeVar, cast
|
|
27
27
|
|
|
28
28
|
import aiohttp
|
|
29
|
-
from aiohttp import ClientResponseError
|
|
30
29
|
from asgiref.sync import sync_to_async
|
|
31
30
|
from requests.auth import AuthBase
|
|
32
31
|
from requests.sessions import Session
|
|
@@ -182,9 +181,12 @@ class DbtCloudHook(HttpHook):
|
|
|
182
181
|
def get_ui_field_behaviour(cls) -> dict[str, Any]:
|
|
183
182
|
"""Build custom field behavior for the dbt Cloud connection form in the Airflow UI."""
|
|
184
183
|
return {
|
|
185
|
-
"hidden_fields": ["schema", "port"
|
|
184
|
+
"hidden_fields": ["schema", "port"],
|
|
186
185
|
"relabeling": {"login": "Account ID", "password": "API Token", "host": "Tenant"},
|
|
187
|
-
"placeholders": {
|
|
186
|
+
"placeholders": {
|
|
187
|
+
"host": "Defaults to 'cloud.getdbt.com'.",
|
|
188
|
+
"extra": "Optional JSON-formatted extra.",
|
|
189
|
+
},
|
|
188
190
|
}
|
|
189
191
|
|
|
190
192
|
def __init__(self, dbt_cloud_conn_id: str = default_conn_name, *args, **kwargs) -> None:
|
|
@@ -195,6 +197,10 @@ class DbtCloudHook(HttpHook):
|
|
|
195
197
|
def _get_tenant_domain(conn: Connection) -> str:
|
|
196
198
|
return conn.host or "cloud.getdbt.com"
|
|
197
199
|
|
|
200
|
+
@staticmethod
|
|
201
|
+
def _get_proxies(conn: Connection) -> dict[str, str] | None:
|
|
202
|
+
return conn.extra_dejson.get("proxies", None)
|
|
203
|
+
|
|
198
204
|
@staticmethod
|
|
199
205
|
def get_request_url_params(
|
|
200
206
|
tenant: str, endpoint: str, include_related: list[str] | None = None, *, api_version: str = "v2"
|
|
@@ -238,14 +244,18 @@ class DbtCloudHook(HttpHook):
|
|
|
238
244
|
endpoint = f"{account_id}/runs/{run_id}/"
|
|
239
245
|
headers, tenant = await self.get_headers_tenants_from_connection()
|
|
240
246
|
url, params = self.get_request_url_params(tenant, endpoint, include_related)
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
) as
|
|
244
|
-
|
|
247
|
+
proxies = self._get_proxies(self.connection) or {}
|
|
248
|
+
|
|
249
|
+
async with aiohttp.ClientSession(headers=headers) as session:
|
|
250
|
+
proxy = proxies.get("https") if proxies and url.startswith("https") else proxies.get("http")
|
|
251
|
+
extra_request_args = {}
|
|
252
|
+
|
|
253
|
+
if proxy:
|
|
254
|
+
extra_request_args["proxy"] = proxy
|
|
255
|
+
|
|
256
|
+
async with session.get(url, params=params, **extra_request_args) as response: # type: ignore[arg-type]
|
|
245
257
|
response.raise_for_status()
|
|
246
258
|
return await response.json()
|
|
247
|
-
except ClientResponseError as e:
|
|
248
|
-
raise AirflowException(f"{e.status}:{e.message}")
|
|
249
259
|
|
|
250
260
|
async def get_job_status(
|
|
251
261
|
self, run_id: int, account_id: int | None = None, include_related: list[str] | None = None
|
|
@@ -280,8 +290,11 @@ class DbtCloudHook(HttpHook):
|
|
|
280
290
|
|
|
281
291
|
return session
|
|
282
292
|
|
|
283
|
-
def _paginate(
|
|
284
|
-
|
|
293
|
+
def _paginate(
|
|
294
|
+
self, endpoint: str, payload: dict[str, Any] | None = None, proxies: dict[str, str] | None = None
|
|
295
|
+
) -> list[Response]:
|
|
296
|
+
extra_options = {"proxies": proxies} if proxies is not None else None
|
|
297
|
+
response = self.run(endpoint=endpoint, data=payload, extra_options=extra_options)
|
|
285
298
|
resp_json = response.json()
|
|
286
299
|
limit = resp_json["extra"]["filters"]["limit"]
|
|
287
300
|
num_total_results = resp_json["extra"]["pagination"]["total_count"]
|
|
@@ -292,7 +305,7 @@ class DbtCloudHook(HttpHook):
|
|
|
292
305
|
_paginate_payload["offset"] = limit
|
|
293
306
|
|
|
294
307
|
while num_current_results < num_total_results:
|
|
295
|
-
response = self.run(endpoint=endpoint, data=_paginate_payload)
|
|
308
|
+
response = self.run(endpoint=endpoint, data=_paginate_payload, extra_options=extra_options)
|
|
296
309
|
resp_json = response.json()
|
|
297
310
|
results.append(response)
|
|
298
311
|
num_current_results += resp_json["extra"]["pagination"]["count"]
|
|
@@ -310,17 +323,20 @@ class DbtCloudHook(HttpHook):
|
|
|
310
323
|
) -> Any:
|
|
311
324
|
self.method = method
|
|
312
325
|
full_endpoint = f"api/{api_version}/accounts/{endpoint}" if endpoint else None
|
|
326
|
+
proxies = self._get_proxies(self.connection)
|
|
327
|
+
extra_options = {"proxies": proxies} if proxies is not None else None
|
|
313
328
|
|
|
314
329
|
if paginate:
|
|
315
330
|
if isinstance(payload, str):
|
|
316
331
|
raise ValueError("Payload cannot be a string to paginate a response.")
|
|
317
332
|
|
|
318
333
|
if full_endpoint:
|
|
319
|
-
return self._paginate(endpoint=full_endpoint, payload=payload)
|
|
334
|
+
return self._paginate(endpoint=full_endpoint, payload=payload, proxies=proxies)
|
|
320
335
|
|
|
321
336
|
raise ValueError("An endpoint is needed to paginate a response.")
|
|
322
337
|
|
|
323
|
-
|
|
338
|
+
# breakpoint()
|
|
339
|
+
return self.run(endpoint=full_endpoint, data=payload, extra_options=extra_options)
|
|
324
340
|
|
|
325
341
|
def list_accounts(self) -> list[Response]:
|
|
326
342
|
"""
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: apache-airflow-providers-dbt-cloud
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.11.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>
|
|
7
7
|
Maintainer-email: Apache Software Foundation <dev@airflow.apache.org>
|
|
8
|
-
Requires-Python: ~=3.
|
|
8
|
+
Requires-Python: ~=3.9
|
|
9
9
|
Description-Content-Type: text/x-rst
|
|
10
10
|
Classifier: Development Status :: 5 - Production/Stable
|
|
11
11
|
Classifier: Environment :: Console
|
|
@@ -15,7 +15,6 @@ Classifier: Intended Audience :: System Administrators
|
|
|
15
15
|
Classifier: Framework :: Apache Airflow
|
|
16
16
|
Classifier: Framework :: Apache Airflow :: Provider
|
|
17
17
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.9
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -28,8 +27,8 @@ Requires-Dist: asgiref
|
|
|
28
27
|
Requires-Dist: apache-airflow-providers-http ; extra == "http"
|
|
29
28
|
Requires-Dist: apache-airflow-providers-openlineage>=1.7.0rc0 ; extra == "openlineage"
|
|
30
29
|
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.
|
|
32
|
-
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.
|
|
30
|
+
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.11.0/changelog.html
|
|
31
|
+
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.11.0
|
|
33
32
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
|
34
33
|
Project-URL: Source Code, https://github.com/apache/airflow
|
|
35
34
|
Project-URL: Twitter, https://twitter.com/ApacheAirflow
|
|
@@ -81,7 +80,7 @@ Provides-Extra: openlineage
|
|
|
81
80
|
|
|
82
81
|
Package ``apache-airflow-providers-dbt-cloud``
|
|
83
82
|
|
|
84
|
-
Release: ``3.
|
|
83
|
+
Release: ``3.11.0.rc1``
|
|
85
84
|
|
|
86
85
|
|
|
87
86
|
`dbt Cloud <https://www.getdbt.com/product/dbt-cloud/>`__
|
|
@@ -94,7 +93,7 @@ This is a provider package for ``dbt.cloud`` provider. All classes for this prov
|
|
|
94
93
|
are in ``airflow.providers.dbt.cloud`` python package.
|
|
95
94
|
|
|
96
95
|
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.
|
|
96
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.11.0/>`_.
|
|
98
97
|
|
|
99
98
|
Installation
|
|
100
99
|
------------
|
|
@@ -103,7 +102,7 @@ You can install this package on top of an existing Airflow 2 installation (see `
|
|
|
103
102
|
for the minimum Airflow version supported) via
|
|
104
103
|
``pip install apache-airflow-providers-dbt-cloud``
|
|
105
104
|
|
|
106
|
-
The package supports the following python versions: 3.
|
|
105
|
+
The package supports the following python versions: 3.9,3.10,3.11,3.12
|
|
107
106
|
|
|
108
107
|
Requirements
|
|
109
108
|
------------
|
|
@@ -138,4 +137,4 @@ Dependent package
|
|
|
138
137
|
============================================================================================================== ===============
|
|
139
138
|
|
|
140
139
|
The changelog for the provider package can be found in the
|
|
141
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.
|
|
140
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.11.0/changelog.html>`_.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
airflow/providers/dbt/cloud/LICENSE,sha256=FFb4jd2AXnOOf7XLP04pQW6jbdhG49TxlGY6fFpCV1Y,13609
|
|
2
|
-
airflow/providers/dbt/cloud/__init__.py,sha256
|
|
3
|
-
airflow/providers/dbt/cloud/get_provider_info.py,sha256=
|
|
2
|
+
airflow/providers/dbt/cloud/__init__.py,sha256=-rFvFoF_l55t6GWp5ReSIvh9E-uzVtHuMA4xqykGcw8,1497
|
|
3
|
+
airflow/providers/dbt/cloud/get_provider_info.py,sha256=bUczi6uxgLzfi5gWW__531rpS_mqbLBfFW8C8XW01HQ,3705
|
|
4
4
|
airflow/providers/dbt/cloud/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
5
|
-
airflow/providers/dbt/cloud/hooks/dbt.py,sha256=
|
|
5
|
+
airflow/providers/dbt/cloud/hooks/dbt.py,sha256=MT1dChJs0IcRlcY5piOV3N9cZ5KsWehbk6PXVQAR32k,29193
|
|
6
6
|
airflow/providers/dbt/cloud/operators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
7
7
|
airflow/providers/dbt/cloud/operators/dbt.py,sha256=jgdk-Ve8YKYy5Twz9lq74iQpElEI_mS1IwASmCqPDQY,16159
|
|
8
8
|
airflow/providers/dbt/cloud/sensors/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
|
@@ -11,7 +11,7 @@ airflow/providers/dbt/cloud/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOF
|
|
|
11
11
|
airflow/providers/dbt/cloud/triggers/dbt.py,sha256=30fntKeUi1bUJtv50Rv09KtJNsN8gBtjLPsf3Xoccks,4680
|
|
12
12
|
airflow/providers/dbt/cloud/utils/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
13
13
|
airflow/providers/dbt/cloud/utils/openlineage.py,sha256=tLHfM6L9cOy4ZvpnJFjJAI3qxAztn073GbLHsXpjvFQ,6265
|
|
14
|
-
apache_airflow_providers_dbt_cloud-3.
|
|
15
|
-
apache_airflow_providers_dbt_cloud-3.
|
|
16
|
-
apache_airflow_providers_dbt_cloud-3.
|
|
17
|
-
apache_airflow_providers_dbt_cloud-3.
|
|
14
|
+
apache_airflow_providers_dbt_cloud-3.11.0rc1.dist-info/entry_points.txt,sha256=c18L1WEEK18WQeEGrm9kMVqutiYJHiWGH5jU1JqnToE,105
|
|
15
|
+
apache_airflow_providers_dbt_cloud-3.11.0rc1.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
16
|
+
apache_airflow_providers_dbt_cloud-3.11.0rc1.dist-info/METADATA,sha256=9HP7WULRPu2M2_GcRhUiNyl4qoemeM3EfJS2mr14kEo,6315
|
|
17
|
+
apache_airflow_providers_dbt_cloud-3.11.0rc1.dist-info/RECORD,,
|
|
File without changes
|