apache-airflow-providers-dbt-cloud 3.10.1rc1__tar.gz → 3.11.0__tar.gz

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.

Files changed (16) hide show
  1. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/PKG-INFO +10 -11
  2. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/README.rst +4 -4
  3. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/airflow/providers/dbt/cloud/__init__.py +1 -1
  4. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/airflow/providers/dbt/cloud/get_provider_info.py +2 -1
  5. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/airflow/providers/dbt/cloud/hooks/dbt.py +30 -14
  6. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/pyproject.toml +6 -7
  7. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/airflow/providers/dbt/cloud/LICENSE +0 -0
  8. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/airflow/providers/dbt/cloud/hooks/__init__.py +0 -0
  9. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/airflow/providers/dbt/cloud/operators/__init__.py +0 -0
  10. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/airflow/providers/dbt/cloud/operators/dbt.py +0 -0
  11. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/airflow/providers/dbt/cloud/sensors/__init__.py +0 -0
  12. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/airflow/providers/dbt/cloud/sensors/dbt.py +0 -0
  13. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/airflow/providers/dbt/cloud/triggers/__init__.py +0 -0
  14. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/airflow/providers/dbt/cloud/triggers/dbt.py +0 -0
  15. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/airflow/providers/dbt/cloud/utils/__init__.py +0 -0
  16. {apache_airflow_providers_dbt_cloud-3.10.1rc1 → apache_airflow_providers_dbt_cloud-3.11.0}/airflow/providers/dbt/cloud/utils/openlineage.py +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-dbt-cloud
3
- Version: 3.10.1rc1
3
+ Version: 3.11.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>
7
7
  Maintainer-email: Apache Software Foundation <dev@airflow.apache.org>
8
- Requires-Python: ~=3.8
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
@@ -23,13 +22,13 @@ Classifier: Programming Language :: Python :: 3.12
23
22
  Classifier: Topic :: System :: Monitoring
24
23
  Requires-Dist: aiohttp>=3.9.2
25
24
  Requires-Dist: apache-airflow-providers-http
26
- Requires-Dist: apache-airflow>=2.8.0rc0
25
+ Requires-Dist: apache-airflow>=2.8.0
27
26
  Requires-Dist: asgiref
28
27
  Requires-Dist: apache-airflow-providers-http ; extra == "http"
29
- Requires-Dist: apache-airflow-providers-openlineage>=1.7.0rc0 ; extra == "openlineage"
28
+ Requires-Dist: apache-airflow-providers-openlineage>=1.7.0 ; 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.10.1/changelog.html
32
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.10.1
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.10.1.rc1``
83
+ Release: ``3.11.0``
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.10.1/>`_.
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.8,3.9,3.10,3.11,3.12
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.10.1/changelog.html>`_.
140
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.11.0/changelog.html>`_.
@@ -42,7 +42,7 @@
42
42
 
43
43
  Package ``apache-airflow-providers-dbt-cloud``
44
44
 
45
- Release: ``3.10.1.rc1``
45
+ Release: ``3.11.0``
46
46
 
47
47
 
48
48
  `dbt Cloud <https://www.getdbt.com/product/dbt-cloud/>`__
@@ -55,7 +55,7 @@ This is a provider package for ``dbt.cloud`` provider. All classes for this prov
55
55
  are in ``airflow.providers.dbt.cloud`` python package.
56
56
 
57
57
  You can find package information and changelog for the provider
58
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.10.1/>`_.
58
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.11.0/>`_.
59
59
 
60
60
  Installation
61
61
  ------------
@@ -64,7 +64,7 @@ You can install this package on top of an existing Airflow 2 installation (see `
64
64
  for the minimum Airflow version supported) via
65
65
  ``pip install apache-airflow-providers-dbt-cloud``
66
66
 
67
- The package supports the following python versions: 3.8,3.9,3.10,3.11,3.12
67
+ The package supports the following python versions: 3.9,3.10,3.11,3.12
68
68
 
69
69
  Requirements
70
70
  ------------
@@ -99,4 +99,4 @@ Dependent package
99
99
  ============================================================================================================== ===============
100
100
 
101
101
  The changelog for the provider package can be found in the
102
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.10.1/changelog.html>`_.
102
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.11.0/changelog.html>`_.
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "3.10.1"
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": 1726860654,
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", "extra"],
184
+ "hidden_fields": ["schema", "port"],
186
185
  "relabeling": {"login": "Account ID", "password": "API Token", "host": "Tenant"},
187
- "placeholders": {"host": "Defaults to 'cloud.getdbt.com'."},
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
- async with aiohttp.ClientSession(headers=headers) as session, session.get(
242
- url, params=params
243
- ) as response:
244
- try:
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(self, endpoint: str, payload: dict[str, Any] | None = None) -> list[Response]:
284
- response = self.run(endpoint=endpoint, data=payload)
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
- return self.run(endpoint=full_endpoint, data=payload)
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
  """
@@ -28,7 +28,7 @@ build-backend = "flit_core.buildapi"
28
28
 
29
29
  [project]
30
30
  name = "apache-airflow-providers-dbt-cloud"
31
- version = "3.10.1.rc1"
31
+ version = "3.11.0"
32
32
  description = "Provider package apache-airflow-providers-dbt-cloud for Apache Airflow"
33
33
  readme = "README.rst"
34
34
  authors = [
@@ -47,24 +47,23 @@ classifiers = [
47
47
  "Framework :: Apache Airflow",
48
48
  "Framework :: Apache Airflow :: Provider",
49
49
  "License :: OSI Approved :: Apache Software License",
50
- "Programming Language :: Python :: 3.8",
51
50
  "Programming Language :: Python :: 3.9",
52
51
  "Programming Language :: Python :: 3.10",
53
52
  "Programming Language :: Python :: 3.11",
54
53
  "Programming Language :: Python :: 3.12",
55
54
  "Topic :: System :: Monitoring",
56
55
  ]
57
- requires-python = "~=3.8"
56
+ requires-python = "~=3.9"
58
57
  dependencies = [
59
58
  "aiohttp>=3.9.2",
60
59
  "apache-airflow-providers-http",
61
- "apache-airflow>=2.8.0rc0",
60
+ "apache-airflow>=2.8.0",
62
61
  "asgiref",
63
62
  ]
64
63
 
65
64
  [project.urls]
66
- "Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.10.1"
67
- "Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.10.1/changelog.html"
65
+ "Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.11.0"
66
+ "Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.11.0/changelog.html"
68
67
  "Bug Tracker" = "https://github.com/apache/airflow/issues"
69
68
  "Source Code" = "https://github.com/apache/airflow"
70
69
  "Slack Chat" = "https://s.apache.org/airflow-slack"
@@ -78,7 +77,7 @@ provider_info = "airflow.providers.dbt.cloud.get_provider_info:get_provider_info
78
77
  "apache-airflow-providers-http",
79
78
  ]
80
79
  "openlineage" = [
81
- "apache-airflow-providers-openlineage>=1.7.0rc0",
80
+ "apache-airflow-providers-openlineage>=1.7.0",
82
81
  ]
83
82
 
84
83
  [tool.flit.module]