airflow-dbt-python 3.0.2__tar.gz → 3.0.3__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.
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/PKG-INFO +1 -1
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/__version__.py +1 -1
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/hooks/target.py +26 -1
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/utils/configs.py +6 -2
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python.egg-info/PKG-INFO +1 -1
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/pyproject.toml +1 -21
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/LICENSE +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/README.md +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/__init__.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/hooks/__init__.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/hooks/dbt.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/hooks/fs/__init__.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/hooks/fs/gcs.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/hooks/fs/git.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/hooks/fs/local.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/hooks/fs/s3.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/operators/__init__.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/operators/dbt.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/utils/__init__.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/utils/enums.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/utils/env.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/utils/url.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/utils/version.py +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python.egg-info/SOURCES.txt +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python.egg-info/dependency_links.txt +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python.egg-info/requires.txt +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python.egg-info/top_level.txt +0 -0
- {airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/setup.cfg +0 -0
|
@@ -7,6 +7,8 @@ specific connection requirements.
|
|
|
7
7
|
|
|
8
8
|
from __future__ import annotations
|
|
9
9
|
|
|
10
|
+
import base64
|
|
11
|
+
import binascii
|
|
10
12
|
import json
|
|
11
13
|
import operator
|
|
12
14
|
import re
|
|
@@ -26,6 +28,24 @@ from airflow.hooks.base import BaseHook
|
|
|
26
28
|
from airflow.models.connection import Connection
|
|
27
29
|
|
|
28
30
|
|
|
31
|
+
def try_decode_base64(s: str) -> str:
|
|
32
|
+
"""Attempt to decode a string from base64.
|
|
33
|
+
|
|
34
|
+
If the string is not valid base64, returns the original value.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
s: The string to decode.
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
The decoded string, or the original value if decoding fails.
|
|
41
|
+
"""
|
|
42
|
+
try:
|
|
43
|
+
s = base64.b64decode(s, validate=True).decode("utf-8")
|
|
44
|
+
except binascii.Error:
|
|
45
|
+
pass
|
|
46
|
+
return s
|
|
47
|
+
|
|
48
|
+
|
|
29
49
|
class DbtConnectionParam(NamedTuple):
|
|
30
50
|
"""A tuple indicating connection parameters relevant to dbt.
|
|
31
51
|
|
|
@@ -40,6 +60,7 @@ class DbtConnectionParam(NamedTuple):
|
|
|
40
60
|
name: str
|
|
41
61
|
store_override_name: Optional[str] = None
|
|
42
62
|
default: Optional[Any] = None
|
|
63
|
+
converter: Callable[[Any], Any] | None = None
|
|
43
64
|
|
|
44
65
|
@property
|
|
45
66
|
def override_name(self):
|
|
@@ -230,6 +251,8 @@ class DbtConnectionHook(BaseHook, ABC, metaclass=DbtConnectionHookMeta):
|
|
|
230
251
|
if isinstance(param, DbtConnectionParam):
|
|
231
252
|
key = param.override_name
|
|
232
253
|
value = getattr(conn, param.name, param.default)
|
|
254
|
+
if param.converter:
|
|
255
|
+
value = param.converter(value)
|
|
233
256
|
elif isinstance(param, DbtConnectionConditionParam):
|
|
234
257
|
key, default = param.resolve(conn)
|
|
235
258
|
value = getattr(conn, param.name, default)
|
|
@@ -399,7 +422,9 @@ class DbtSnowflakeHook(DbtConnectionHook):
|
|
|
399
422
|
"database",
|
|
400
423
|
DbtConnectionParam("refresh_token", "token"),
|
|
401
424
|
DbtConnectionParam("private_key_file", "private_key_path"),
|
|
402
|
-
DbtConnectionParam(
|
|
425
|
+
DbtConnectionParam(
|
|
426
|
+
"private_key_content", "private_key", converter=try_decode_base64
|
|
427
|
+
),
|
|
403
428
|
]
|
|
404
429
|
|
|
405
430
|
|
|
@@ -181,14 +181,18 @@ class BaseConfig:
|
|
|
181
181
|
|
|
182
182
|
# legacy behaviors - https://github.com/dbt-labs/dbt-core/blob/main/docs/guides/behavior-change-flags.md
|
|
183
183
|
require_batched_execution_for_custom_microbatch_strategy: bool = False
|
|
184
|
+
require_event_names_in_deprecations: bool = False
|
|
184
185
|
require_explicit_package_overrides_for_builtin_materializations: bool = True
|
|
185
|
-
require_resource_names_without_spaces: bool =
|
|
186
|
-
source_freshness_run_project_hooks: bool =
|
|
186
|
+
require_resource_names_without_spaces: bool = True
|
|
187
|
+
source_freshness_run_project_hooks: bool = True
|
|
187
188
|
skip_nodes_if_on_run_start_fails: bool = False
|
|
188
189
|
state_modified_compare_more_unrendered_values: bool = False
|
|
189
190
|
state_modified_compare_vars: bool = False
|
|
190
191
|
require_yaml_configuration_for_mf_time_spines: bool = False
|
|
191
192
|
require_nested_cumulative_type_params: bool = False
|
|
193
|
+
validate_macro_args: bool = False
|
|
194
|
+
require_all_warnings_handled_by_warn_error: bool = False
|
|
195
|
+
require_generic_test_arguments_property: bool = False
|
|
192
196
|
|
|
193
197
|
def __post_init__(self):
|
|
194
198
|
"""Post initialization actions for a dbt configuration."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "airflow-dbt-python"
|
|
3
|
-
version = "3.0.
|
|
3
|
+
version = "3.0.3"
|
|
4
4
|
description = "A collection of Airflow operators, hooks, and utilities to execute dbt commands"
|
|
5
5
|
authors = [{ name = "Tomás Farías Santana", email = "tomas@tomasfarias.dev" }]
|
|
6
6
|
license = "MIT"
|
|
@@ -71,7 +71,6 @@ dev = [
|
|
|
71
71
|
"apache-airflow-providers-amazon>=3.0.0",
|
|
72
72
|
"apache-airflow-providers-google>=11.0.0",
|
|
73
73
|
"apache-airflow-providers-ssh>=3.0.0",
|
|
74
|
-
"black>=22",
|
|
75
74
|
"boto3-stubs[s3]>=1.26.8",
|
|
76
75
|
"coverage[toml]>=7.2",
|
|
77
76
|
# docutils 0.21 causes an error with poetry (https://github.com/python-poetry/poetry/issues/9293)
|
|
@@ -97,25 +96,6 @@ docs = [
|
|
|
97
96
|
"zipp>=3.19.1",
|
|
98
97
|
]
|
|
99
98
|
|
|
100
|
-
[tool.black]
|
|
101
|
-
line-length = 88
|
|
102
|
-
target-version = ["py39", "py310", "py311", "py312"]
|
|
103
|
-
include = '\.pyi?$'
|
|
104
|
-
exclude = '''
|
|
105
|
-
/(
|
|
106
|
-
\.eggs
|
|
107
|
-
| \.git
|
|
108
|
-
| \.hg
|
|
109
|
-
| \.mypy_cache
|
|
110
|
-
| \.tox
|
|
111
|
-
| \.venv
|
|
112
|
-
| _build
|
|
113
|
-
| buck-out
|
|
114
|
-
| build
|
|
115
|
-
| dist
|
|
116
|
-
)/
|
|
117
|
-
'''
|
|
118
|
-
|
|
119
99
|
[tool.coverage.run]
|
|
120
100
|
source = ["airflow_dbt_python"]
|
|
121
101
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/hooks/fs/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python/operators/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python.egg-info/requires.txt
RENAMED
|
File without changes
|
{airflow_dbt_python-3.0.2 → airflow_dbt_python-3.0.3}/airflow_dbt_python.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|