dbt-adapters 1.13.2__py3-none-any.whl → 1.14.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 dbt-adapters might be problematic. Click here for more details.
- dbt/adapters/__about__.py +1 -1
- dbt/adapters/base/impl.py +6 -1
- dbt/include/global_project/macros/materializations/models/incremental/merge.sql +7 -5
- dbt/include/global_project/macros/materializations/snapshots/helpers.sql +8 -3
- dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql +4 -2
- dbt/include/global_project/macros/utils/equals.sql +14 -0
- {dbt_adapters-1.13.2.dist-info → dbt_adapters-1.14.0.dist-info}/METADATA +4 -4
- {dbt_adapters-1.13.2.dist-info → dbt_adapters-1.14.0.dist-info}/RECORD +10 -10
- dbt/__init__.py +0 -6
- {dbt_adapters-1.13.2.dist-info → dbt_adapters-1.14.0.dist-info}/WHEEL +0 -0
- {dbt_adapters-1.13.2.dist-info → dbt_adapters-1.14.0.dist-info}/licenses/LICENSE +0 -0
dbt/adapters/__about__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = "1.
|
|
1
|
+
version = "1.14.0"
|
dbt/adapters/base/impl.py
CHANGED
|
@@ -104,7 +104,12 @@ DEFAULT_BASE_BEHAVIOR_FLAGS = [
|
|
|
104
104
|
"name": "require_batched_execution_for_custom_microbatch_strategy",
|
|
105
105
|
"default": False,
|
|
106
106
|
"docs_url": "https://docs.getdbt.com/docs/build/incremental-microbatch",
|
|
107
|
-
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "enable_truthy_nulls_equals_macro",
|
|
110
|
+
"default": False,
|
|
111
|
+
"docs_url": "",
|
|
112
|
+
},
|
|
108
113
|
]
|
|
109
114
|
|
|
110
115
|
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
{% do predicates.append(this_key_match) %}
|
|
22
22
|
{% endfor %}
|
|
23
23
|
{% else %}
|
|
24
|
-
{% set
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
{% set source_unique_key = ("DBT_INTERNAL_SOURCE." ~ unique_key) | trim %}
|
|
25
|
+
{% set target_unique_key = ("DBT_INTERNAL_DEST." ~ unique_key) | trim %}
|
|
26
|
+
{% set unique_key_match = equals(source_unique_key, target_unique_key) | trim %}
|
|
27
27
|
{% do predicates.append(unique_key_match) %}
|
|
28
28
|
{% endif %}
|
|
29
29
|
{% else %}
|
|
@@ -62,11 +62,13 @@
|
|
|
62
62
|
|
|
63
63
|
{% if unique_key %}
|
|
64
64
|
{% if unique_key is sequence and unique_key is not string %}
|
|
65
|
-
delete from {{target }}
|
|
65
|
+
delete from {{ target }}
|
|
66
66
|
using {{ source }}
|
|
67
67
|
where (
|
|
68
68
|
{% for key in unique_key %}
|
|
69
|
-
|
|
69
|
+
{% set source_unique_key = (source ~ "." ~ key) | trim %}
|
|
70
|
+
{% set target_unique_key = (target ~ "." ~ key) | trim %}
|
|
71
|
+
{{ equals(source_unique_key, target_unique_key) }}
|
|
70
72
|
{{ "and " if not loop.last}}
|
|
71
73
|
{% endfor %}
|
|
72
74
|
{% if incremental_predicates %}
|
|
@@ -55,8 +55,11 @@
|
|
|
55
55
|
from {{ target_relation }}
|
|
56
56
|
where
|
|
57
57
|
{% if config.get('dbt_valid_to_current') %}
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
{% set source_unique_key = columns.dbt_valid_to | trim %}
|
|
59
|
+
{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}
|
|
60
|
+
|
|
61
|
+
{# The exact equals semantics between NULL values depends on the current behavior flag set. Also, update records if the source field is null #}
|
|
62
|
+
( {{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null )
|
|
60
63
|
{% else %}
|
|
61
64
|
{{ columns.dbt_valid_to }} is null
|
|
62
65
|
{% endif %}
|
|
@@ -279,7 +282,9 @@
|
|
|
279
282
|
{% macro unique_key_join_on(unique_key, identifier, from_identifier) %}
|
|
280
283
|
{% if unique_key | is_list %}
|
|
281
284
|
{% for key in unique_key %}
|
|
282
|
-
|
|
285
|
+
{% set source_unique_key = (identifier ~ ".dbt_unique_key_" ~ loop.index) | trim %}
|
|
286
|
+
{% set target_unique_key = (from_identifier ~ ".dbt_unique_key_" ~ loop.index) | trim %}
|
|
287
|
+
{{ equals(source_unique_key, target_unique_key) }}
|
|
283
288
|
{%- if not loop.last %} and {%- endif %}
|
|
284
289
|
{% endfor %}
|
|
285
290
|
{% else %}
|
|
@@ -15,8 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
when matched
|
|
17
17
|
{% if config.get("dbt_valid_to_current") %}
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
{% set source_unique_key = ("DBT_INTERNAL_DEST." ~ columns.dbt_valid_to) | trim %}
|
|
19
|
+
{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}
|
|
20
|
+
and ({{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null)
|
|
21
|
+
|
|
20
22
|
{% else %}
|
|
21
23
|
and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null
|
|
22
24
|
{% endif %}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{% macro equals(expr1, expr2) %}
|
|
2
|
+
{{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }}
|
|
3
|
+
{%- endmacro %}
|
|
4
|
+
|
|
5
|
+
{% macro default__equals(expr1, expr2) -%}
|
|
6
|
+
{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}
|
|
7
|
+
case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null))
|
|
8
|
+
then 0
|
|
9
|
+
else 1
|
|
10
|
+
end = 0
|
|
11
|
+
{%- else -%}
|
|
12
|
+
({{ expr1 }} = {{ expr2 }})
|
|
13
|
+
{%- endif %}
|
|
14
|
+
{% endmacro %}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dbt-adapters
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.14.0
|
|
4
4
|
Summary: The set of adapter protocols and base functionality that supports integration with dbt-core
|
|
5
|
-
Project-URL: Homepage, https://github.com/dbt-labs/dbt-adapters
|
|
5
|
+
Project-URL: Homepage, https://github.com/dbt-labs/dbt-adapters/tree/main/dbt-adapters
|
|
6
6
|
Project-URL: Documentation, https://docs.getdbt.com
|
|
7
|
-
Project-URL: Repository, https://github.com/dbt-labs/dbt-adapters.git
|
|
7
|
+
Project-URL: Repository, https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-adapters
|
|
8
8
|
Project-URL: Issues, https://github.com/dbt-labs/dbt-adapters/issues
|
|
9
|
-
Project-URL: Changelog, https://github.com/dbt-labs/dbt-adapters/blob/main/CHANGELOG.md
|
|
9
|
+
Project-URL: Changelog, https://github.com/dbt-labs/dbt-adapters/blob/main/dbt-adapters/CHANGELOG.md
|
|
10
10
|
Author-email: dbt Labs <info@dbtlabs.com>
|
|
11
11
|
Maintainer-email: dbt Labs <info@dbtlabs.com>
|
|
12
12
|
License-File: LICENSE
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
dbt/
|
|
2
|
-
dbt/adapters/__about__.py,sha256=Cuq7FXEXm6Gn16RqHt8PiAzA3B1au2WWkMt2zQMOb9c,19
|
|
1
|
+
dbt/adapters/__about__.py,sha256=jgA5fU_XZ5Gv-NyYGvOeyOvgy8rP58A_XiIlWHtvbZo,19
|
|
3
2
|
dbt/adapters/__init__.py,sha256=3noHsg-64qI0_Pw6OR9F7l1vU2_qrJvinq8POTtuaZM,252
|
|
4
3
|
dbt/adapters/cache.py,sha256=WGy4ewnz-J13LverTACBW2iFhGswrWLgm-wiBrQnMzo,20084
|
|
5
4
|
dbt/adapters/capability.py,sha256=M3FkC9veKnNB7a7uQyl7EHX_AGNXPChbHAkcY4cgXCY,2534
|
|
@@ -12,7 +11,7 @@ dbt/adapters/base/README.md,sha256=muHQntC07Lh6L1XfVgwKhV5RltOPBLYPdQqd8_7l34c,5
|
|
|
12
11
|
dbt/adapters/base/__init__.py,sha256=Nc8lQVkOzAqdcxk4cw4E_raxN9CAWMwhQx4STdiicxg,456
|
|
13
12
|
dbt/adapters/base/column.py,sha256=Uj20UixoxCn2rlv4QDNONyys6CDkDFyG3anCXKf0T2c,5350
|
|
14
13
|
dbt/adapters/base/connections.py,sha256=-C5dOwGgMKH8n_v6wjwOxV7chBdS0GjOGwNQCUbhhWc,16951
|
|
15
|
-
dbt/adapters/base/impl.py,sha256=
|
|
14
|
+
dbt/adapters/base/impl.py,sha256=bzwmhB_M5SaYNKjUuS6ELzIjIxFNwOdmM85t7_V1B0Y,74919
|
|
16
15
|
dbt/adapters/base/meta.py,sha256=IKqviGf7gK_qGtrn0t8NaSdUaw8g_M8SjICacMvNwGY,5702
|
|
17
16
|
dbt/adapters/base/plugin.py,sha256=rm0GjNHnWM2mn0GJOjciZLwn-02xlzWCoMT9u-epwP0,1076
|
|
18
17
|
dbt/adapters/base/query_headers.py,sha256=UluGd9IYCYkoMiDi5Yx_lnrCOSjWppjwRro4SIGgx8I,3496
|
|
@@ -89,14 +88,14 @@ dbt/include/global_project/macros/materializations/models/clone/create_or_replac
|
|
|
89
88
|
dbt/include/global_project/macros/materializations/models/incremental/column_helpers.sql,sha256=hslQlGKW0oW97srfugsFVRR-L6RrzRcnwr3uLhzI0X4,2577
|
|
90
89
|
dbt/include/global_project/macros/materializations/models/incremental/incremental.sql,sha256=8gyBXan-saJ9GTSa8d05vMa-RSwyZ7pStOeHJpHU4BI,4374
|
|
91
90
|
dbt/include/global_project/macros/materializations/models/incremental/is_incremental.sql,sha256=Sm1TqOeqcCQofj3REFcA97yukPB1J_mClDd55r5GewE,478
|
|
92
|
-
dbt/include/global_project/macros/materializations/models/incremental/merge.sql,sha256=
|
|
91
|
+
dbt/include/global_project/macros/materializations/models/incremental/merge.sql,sha256=STmUSjqR253tq5FcDvFeCPPch4oN2UVi4dxoyFFAq5c,5426
|
|
93
92
|
dbt/include/global_project/macros/materializations/models/incremental/on_schema_change.sql,sha256=EOgcrYhwOGVPnyaBu7kIfe8LTOYVOu-AhxMtBs8ETpQ,4927
|
|
94
93
|
dbt/include/global_project/macros/materializations/models/incremental/strategies.sql,sha256=ORGWiYfj-b3_VIps9FDlyx-Q4A2hZzX2aYLocW8b6pU,2613
|
|
95
94
|
dbt/include/global_project/macros/materializations/seeds/helpers.sql,sha256=Y15ej-D3gm1ExIOMNT208q43gRk8d985WQBuGSooNL0,3920
|
|
96
95
|
dbt/include/global_project/macros/materializations/seeds/seed.sql,sha256=YSoGzVO3iIUiOKIUM9G7yApGLFH4O9bv_d4KjHo3p4Q,2155
|
|
97
|
-
dbt/include/global_project/macros/materializations/snapshots/helpers.sql,sha256
|
|
96
|
+
dbt/include/global_project/macros/materializations/snapshots/helpers.sql,sha256=9Oj_60XhwEByrryf16YQN9J853dCHnXChSyjI_t8kX4,11110
|
|
98
97
|
dbt/include/global_project/macros/materializations/snapshots/snapshot.sql,sha256=clIZtCE7vvOXxzz1t2KlmPZM7AuSGsK7MInspo0N5Qg,4043
|
|
99
|
-
dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql,sha256
|
|
98
|
+
dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql,sha256=WaGQCuv4o_qxBw7b2KQvUnSg0UkPklwAQHK1-QngN_M,1369
|
|
100
99
|
dbt/include/global_project/macros/materializations/snapshots/strategies.sql,sha256=AfIsRiw0YnQym5wUiWR2JpiEEky4_WBTpTtE0HJvpZw,6928
|
|
101
100
|
dbt/include/global_project/macros/materializations/tests/helpers.sql,sha256=rxUxDZm4EvrDbi0H_ePghE34_QLmxGEY2o_LTMc9CU0,1731
|
|
102
101
|
dbt/include/global_project/macros/materializations/tests/test.sql,sha256=Rz3O_3dWHlIofG3d2CwsP2bXFimRZUIwOevyB0iz1J4,1831
|
|
@@ -142,6 +141,7 @@ dbt/include/global_project/macros/utils/date_spine.sql,sha256=to62irsceR0IjA452T
|
|
|
142
141
|
dbt/include/global_project/macros/utils/date_trunc.sql,sha256=N7eDEgKVq6BQ9qUeIMJ_yKQv5QTjIWZ6k2oMWeGlqQU,234
|
|
143
142
|
dbt/include/global_project/macros/utils/dateadd.sql,sha256=-t0IDuV01WOMNsuPjyBp9D-2uvJAdhgi3kE8JIL9Jhc,374
|
|
144
143
|
dbt/include/global_project/macros/utils/datediff.sql,sha256=O94A5XE3sWsdxfwlNODef0BYoaJNGJP-OmurzKZ8qz0,344
|
|
144
|
+
dbt/include/global_project/macros/utils/equals.sql,sha256=xYbyRqXbgU9kpMKh9oBuhCuIYnhKum_3MP7wWmzw7ps,436
|
|
145
145
|
dbt/include/global_project/macros/utils/escape_single_quotes.sql,sha256=1KCciqp1m-xTnmxz73N1r8oZm2oBwq3Nr0NIayyPZvM,343
|
|
146
146
|
dbt/include/global_project/macros/utils/except.sql,sha256=Hf8isn7k8fYbkxtm6wygo-v9uy-Nzlvt07LMfgKxHN4,147
|
|
147
147
|
dbt/include/global_project/macros/utils/generate_series.sql,sha256=abXuCTtmf0WmnDqiCSmYOm6Ha3RutwpmTixfcFTJJeQ,1216
|
|
@@ -157,7 +157,7 @@ dbt/include/global_project/macros/utils/right.sql,sha256=EwNG98CAFIwNDmarwopf7Rk
|
|
|
157
157
|
dbt/include/global_project/macros/utils/safe_cast.sql,sha256=1mswwkDACmIi1I99JKb_-vq3kjMe4HhMRV70mW8Bt4Y,298
|
|
158
158
|
dbt/include/global_project/macros/utils/split_part.sql,sha256=fXEIS0oIiYR7-4lYbb0QbZdG-q2TpV63AFd1ky4I5UM,714
|
|
159
159
|
dbt/include/global_project/tests/generic/builtin.sql,sha256=p94xdyPwb2TlxgLBqCfrcRfJ1QNgsjPvBm8f0Q5eqZM,1022
|
|
160
|
-
dbt_adapters-1.
|
|
161
|
-
dbt_adapters-1.
|
|
162
|
-
dbt_adapters-1.
|
|
163
|
-
dbt_adapters-1.
|
|
160
|
+
dbt_adapters-1.14.0.dist-info/METADATA,sha256=ejgZ1h7Wc-mKL7ytZ-a1HWUlFG5rDLAxnuwDEftrikA,2638
|
|
161
|
+
dbt_adapters-1.14.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
162
|
+
dbt_adapters-1.14.0.dist-info/licenses/LICENSE,sha256=9yjigiJhWcCZvQjdagGKDwrRph58QWc5P2bVSQwXo6s,11344
|
|
163
|
+
dbt_adapters-1.14.0.dist-info/RECORD,,
|
dbt/__init__.py
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
# N.B.
|
|
2
|
-
# This will add to the package’s __path__ all subdirectories of directories on sys.path named after the package which effectively combines both modules into a single namespace (dbt.adapters)
|
|
3
|
-
|
|
4
|
-
from pkgutil import extend_path
|
|
5
|
-
|
|
6
|
-
__path__ = extend_path(__path__, __name__)
|
|
File without changes
|
|
File without changes
|