airflow-dbt-python 3.0.2__py3-none-any.whl → 3.0.3__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.
@@ -3,4 +3,4 @@
3
3
  __author__ = "Tomás Farías Santana"
4
4
  __copyright__ = "Copyright 2021 Tomás Farías Santana"
5
5
  __title__ = "airflow-dbt-python"
6
- __version__ = "3.0.2"
6
+ __version__ = "3.0.3"
@@ -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("private_key_content", "private_key"),
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 = False
186
- source_freshness_run_project_hooks: bool = False
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
  Metadata-Version: 2.4
2
2
  Name: airflow-dbt-python
3
- Version: 3.0.2
3
+ Version: 3.0.3
4
4
  Summary: A collection of Airflow operators, hooks, and utilities to execute dbt commands
5
5
  Author-email: Tomás Farías Santana <tomas@tomasfarias.dev>
6
6
  License-Expression: MIT
@@ -1,8 +1,8 @@
1
1
  airflow_dbt_python/__init__.py,sha256=qYIsTHy4p3NX0QYIsLdatz6GlnaMwYsSoD3wtPD0BqY,153
2
- airflow_dbt_python/__version__.py,sha256=XpfEzvJGA12I8I2T2G5WfMpqAiOxGeHUN_TOjQkqQIE,190
2
+ airflow_dbt_python/__version__.py,sha256=z0eVpLrmqhmOEHh5rdtwkTiE34u2WokgmXHMa5SdC48,190
3
3
  airflow_dbt_python/hooks/__init__.py,sha256=jMdE1qzdpB_4w9IvxTnfB5g6SjEAWq6UDCnQiQi4xLQ,73
4
4
  airflow_dbt_python/hooks/dbt.py,sha256=BPomtFF9Lg2YAy28k5EuNn3lRC116t76hjZzzksAqqc,13762
5
- airflow_dbt_python/hooks/target.py,sha256=K7gmPh_AvoG35uj9Im7MQLL2Xh-CRltQuOLQ_4kvb7s,15411
5
+ airflow_dbt_python/hooks/target.py,sha256=PvTJP0nH5jh8K1iRI_zymJuF8XMuE8Vs-lVfZHKmeeU,16044
6
6
  airflow_dbt_python/hooks/fs/__init__.py,sha256=xwCCHrTyEAUpQiMajEs5sJUFOQLBctqggROMJXEaWew,5527
7
7
  airflow_dbt_python/hooks/fs/gcs.py,sha256=RRF5gvwy_opYIJt6-RF05Ww96SrzIJDrKs859iReRNo,8458
8
8
  airflow_dbt_python/hooks/fs/git.py,sha256=OlAOTrZNTTaubU3grgHCwlgEH2Lj8LCSmiPCV09zJMU,7521
@@ -11,13 +11,13 @@ airflow_dbt_python/hooks/fs/s3.py,sha256=C4l4dalvs2crbl_jDu257_BThF5WOVWvcyDHj1T
11
11
  airflow_dbt_python/operators/__init__.py,sha256=zveHW17YWoCpdsQhCZtvdPoEiFiwWykqPnAnOAQ8vk0,46
12
12
  airflow_dbt_python/operators/dbt.py,sha256=yaov5Vd6pjEkO1XVgEPTK_EvTZUHk4Gc6AB8U5pmXjM,28742
13
13
  airflow_dbt_python/utils/__init__.py,sha256=J3_g-tV35XkrZSwYULsAq4B0TUa6rw0uxP-LFwl_k2Q,45
14
- airflow_dbt_python/utils/configs.py,sha256=mIVxjK45O6xXCzDCrCze8hI9JTP4iiabqfTX9dkVdUA,27202
14
+ airflow_dbt_python/utils/configs.py,sha256=_1ZLAMZKwLdI_X_Vyj5n5QvhhXHYNm3vf4nWDEeemS8,27411
15
15
  airflow_dbt_python/utils/enums.py,sha256=rktUM8cTkEUsdNbzd_f6fxfgNiZGifJfOr0zvrsMyuQ,969
16
16
  airflow_dbt_python/utils/env.py,sha256=o2Y3RMyXADSpUCU-G0yRiqXB-yo3oPsXtCEI7H5GIyM,646
17
17
  airflow_dbt_python/utils/url.py,sha256=Ac7PJMl3AsrVMXGPgFdzOrAVsvCfS4hMWAtwgRMdbP0,16111
18
18
  airflow_dbt_python/utils/version.py,sha256=RAMagzZofIAiFUFc9g06yZXM81BaMI3hH58q4xjfE0M,811
19
- airflow_dbt_python-3.0.2.dist-info/licenses/LICENSE,sha256=8yx5JCe-4cW52JiqVrMlA990r7tuac2foiUryhV9dfY,1073
20
- airflow_dbt_python-3.0.2.dist-info/METADATA,sha256=275OsE0QAshHk3IQgEaY9LpgN7hgG0iUehj9KiFYIf8,15925
21
- airflow_dbt_python-3.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
- airflow_dbt_python-3.0.2.dist-info/top_level.txt,sha256=4mfoYT9MaEb9h9Cyyu8kJwg34TKh_L3fpq0YWx-q60Y,19
23
- airflow_dbt_python-3.0.2.dist-info/RECORD,,
19
+ airflow_dbt_python-3.0.3.dist-info/licenses/LICENSE,sha256=8yx5JCe-4cW52JiqVrMlA990r7tuac2foiUryhV9dfY,1073
20
+ airflow_dbt_python-3.0.3.dist-info/METADATA,sha256=nysoh_Yx3MNXQxL1QEQuYy31QOV-QIhwSrdyhrM7510,15925
21
+ airflow_dbt_python-3.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
+ airflow_dbt_python-3.0.3.dist-info/top_level.txt,sha256=4mfoYT9MaEb9h9Cyyu8kJwg34TKh_L3fpq0YWx-q60Y,19
23
+ airflow_dbt_python-3.0.3.dist-info/RECORD,,