dbt-adapters 1.14.4__py3-none-any.whl → 1.14.6__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/record/cursor/cursor.py +15 -0
- dbt/adapters/record/handle.py +16 -1
- dbt/include/global_project/macros/materializations/models/incremental/incremental.sql +7 -4
- dbt/include/global_project/macros/materializations/models/table.sql +2 -2
- {dbt_adapters-1.14.4.dist-info → dbt_adapters-1.14.6.dist-info}/METADATA +1 -1
- {dbt_adapters-1.14.4.dist-info → dbt_adapters-1.14.6.dist-info}/RECORD +9 -9
- {dbt_adapters-1.14.4.dist-info → dbt_adapters-1.14.6.dist-info}/WHEEL +0 -0
- {dbt_adapters-1.14.4.dist-info → dbt_adapters-1.14.6.dist-info}/licenses/LICENSE +0 -0
dbt/adapters/__about__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = "1.14.
|
|
1
|
+
version = "1.14.6"
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
from typing import Any, Optional
|
|
2
2
|
|
|
3
|
+
from dbt_common.events.base_types import BaseEvent
|
|
4
|
+
from dbt_common.events.functions import fire_event
|
|
5
|
+
from dbt_common.events.types import RecordReplayIssue
|
|
3
6
|
from dbt_common.record import record_function
|
|
4
7
|
|
|
5
8
|
from dbt.adapters.contracts.connection import Connection
|
|
@@ -52,3 +55,15 @@ class RecordReplayCursor:
|
|
|
52
55
|
@record_function(CursorGetDescriptionRecord, method=True, id_field_name="connection_name")
|
|
53
56
|
def description(self) -> str:
|
|
54
57
|
return self.native_cursor.description
|
|
58
|
+
|
|
59
|
+
def _fire_event(self, evt: BaseEvent) -> None:
|
|
60
|
+
"""Wraps fire_event for easier test mocking."""
|
|
61
|
+
fire_event(evt)
|
|
62
|
+
|
|
63
|
+
def __getattr__(self, name: str) -> Any:
|
|
64
|
+
self._fire_event(
|
|
65
|
+
RecordReplayIssue(
|
|
66
|
+
msg=f"Unexpected attribute '{name}' accessed on {self.__class__.__name__}"
|
|
67
|
+
)
|
|
68
|
+
)
|
|
69
|
+
return getattr(self.native_cursor, name)
|
dbt/adapters/record/handle.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
from typing import Any
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from dbt_common.events.base_types import BaseEvent
|
|
4
|
+
from dbt_common.events.functions import fire_event
|
|
5
|
+
from dbt_common.events.types import RecordReplayIssue
|
|
4
6
|
|
|
7
|
+
from dbt.adapters.contracts.connection import Connection
|
|
5
8
|
from dbt.adapters.record.cursor.cursor import RecordReplayCursor
|
|
6
9
|
|
|
7
10
|
|
|
@@ -38,3 +41,15 @@ class RecordReplayHandle:
|
|
|
38
41
|
@property
|
|
39
42
|
def closed(self):
|
|
40
43
|
return self.native_handle.closed
|
|
44
|
+
|
|
45
|
+
def _fire_event(self, evt: BaseEvent) -> None:
|
|
46
|
+
"""Wraps fire_event for easier test mocking."""
|
|
47
|
+
fire_event(evt)
|
|
48
|
+
|
|
49
|
+
def __getattr__(self, name: str) -> Any:
|
|
50
|
+
self._fire_event(
|
|
51
|
+
RecordReplayIssue(
|
|
52
|
+
msg=f"Unexpected attribute '{name}' accessed on {self.__class__.__name__}"
|
|
53
|
+
)
|
|
54
|
+
)
|
|
55
|
+
return getattr(self.native_handle, name)
|
|
@@ -37,11 +37,14 @@
|
|
|
37
37
|
|
|
38
38
|
{% if existing_relation is none %}
|
|
39
39
|
{% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}
|
|
40
|
+
{% set relation_for_indexes = target_relation %}
|
|
40
41
|
{% elif full_refresh_mode %}
|
|
41
42
|
{% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}
|
|
43
|
+
{% set relation_for_indexes = intermediate_relation %}
|
|
42
44
|
{% set need_swap = true %}
|
|
43
45
|
{% else %}
|
|
44
46
|
{% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}
|
|
47
|
+
{% set relation_for_indexes = temp_relation %}
|
|
45
48
|
{% set contract_config = config.get('contract') %}
|
|
46
49
|
{% if not contract_config or not contract_config.enforced %}
|
|
47
50
|
{% do adapter.expand_target_column_types(
|
|
@@ -65,6 +68,10 @@
|
|
|
65
68
|
{{ build_sql }}
|
|
66
69
|
{% endcall %}
|
|
67
70
|
|
|
71
|
+
{% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}
|
|
72
|
+
{% do create_indexes(relation_for_indexes) %}
|
|
73
|
+
{% endif %}
|
|
74
|
+
|
|
68
75
|
{% if need_swap %}
|
|
69
76
|
{% do adapter.rename_relation(target_relation, backup_relation) %}
|
|
70
77
|
{% do adapter.rename_relation(intermediate_relation, target_relation) %}
|
|
@@ -76,10 +83,6 @@
|
|
|
76
83
|
|
|
77
84
|
{% do persist_docs(target_relation, model) %}
|
|
78
85
|
|
|
79
|
-
{% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}
|
|
80
|
-
{% do create_indexes(target_relation) %}
|
|
81
|
-
{% endif %}
|
|
82
|
-
|
|
83
86
|
{{ run_hooks(post_hooks, inside_transaction=True) }}
|
|
84
87
|
|
|
85
88
|
-- `COMMIT` happens here
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
{{ get_create_table_as_sql(False, intermediate_relation, sql) }}
|
|
32
32
|
{%- endcall %}
|
|
33
33
|
|
|
34
|
+
{% do create_indexes(intermediate_relation) %}
|
|
35
|
+
|
|
34
36
|
-- cleanup
|
|
35
37
|
{% if existing_relation is not none %}
|
|
36
38
|
/* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped
|
|
@@ -43,8 +45,6 @@
|
|
|
43
45
|
|
|
44
46
|
{{ adapter.rename_relation(intermediate_relation, target_relation) }}
|
|
45
47
|
|
|
46
|
-
{% do create_indexes(target_relation) %}
|
|
47
|
-
|
|
48
48
|
{{ run_hooks(post_hooks, inside_transaction=True) }}
|
|
49
49
|
|
|
50
50
|
{% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dbt-adapters
|
|
3
|
-
Version: 1.14.
|
|
3
|
+
Version: 1.14.6
|
|
4
4
|
Summary: The set of adapter protocols and base functionality that supports integration with dbt-core
|
|
5
5
|
Project-URL: Homepage, https://github.com/dbt-labs/dbt-adapters/tree/main/dbt-adapters
|
|
6
6
|
Project-URL: Documentation, https://docs.getdbt.com
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
dbt/adapters/__about__.py,sha256=
|
|
1
|
+
dbt/adapters/__about__.py,sha256=pbsrakEKX3-y5858oSToUxcG4rrMV6TjRgLZdDEfnqs,19
|
|
2
2
|
dbt/adapters/__init__.py,sha256=3noHsg-64qI0_Pw6OR9F7l1vU2_qrJvinq8POTtuaZM,252
|
|
3
3
|
dbt/adapters/cache.py,sha256=WGy4ewnz-J13LverTACBW2iFhGswrWLgm-wiBrQnMzo,20084
|
|
4
4
|
dbt/adapters/capability.py,sha256=M3FkC9veKnNB7a7uQyl7EHX_AGNXPChbHAkcY4cgXCY,2534
|
|
@@ -41,9 +41,9 @@ dbt/adapters/exceptions/connection.py,sha256=x82j2Ix242Slm6Ima8Tol3GLOB9yZYH5lq6
|
|
|
41
41
|
dbt/adapters/exceptions/database.py,sha256=nIXJdQyPQOZaiKvCkQ3MoKlKOiaN58rtDZflw3CSkug,1618
|
|
42
42
|
dbt/adapters/record/__init__.py,sha256=u_0eJzN5RL90oL-RNoP2wWGMCGp0kG0lZ0uVWnnGdxs,123
|
|
43
43
|
dbt/adapters/record/base.py,sha256=oqBeddunk9bAyNZBC2pWQohYtD6_ju_tf_74I6NAN04,4277
|
|
44
|
-
dbt/adapters/record/handle.py,sha256=
|
|
44
|
+
dbt/adapters/record/handle.py,sha256=hCQpDmZGKqJXrSqgYcb-F542TZi069uz1MY9fS15INo,1907
|
|
45
45
|
dbt/adapters/record/serialization.py,sha256=ehcLioi4J7TujP58fMNGcePuMxx-2G4Dj1KoYm6j6FU,756
|
|
46
|
-
dbt/adapters/record/cursor/cursor.py,sha256=
|
|
46
|
+
dbt/adapters/record/cursor/cursor.py,sha256=AW0B1g0j5mn7pUnvsE7zd4_Zi7cSFOsyvPbE2HV0CPI,2967
|
|
47
47
|
dbt/adapters/record/cursor/description.py,sha256=5LNebP2AF2aicPWfM9FsD5r7SAmdac8TX_4NZfJQgPk,1060
|
|
48
48
|
dbt/adapters/record/cursor/execute.py,sha256=f8Yc1MKExj7QLbFnK8WnnwsoGESuYMWnFWhytbcAPjc,1271
|
|
49
49
|
dbt/adapters/record/cursor/fetchall.py,sha256=tcvxHOleST2vrP9Bs_HAbAGutLv9za2vH32HCl8ayc4,2149
|
|
@@ -86,13 +86,13 @@ dbt/include/global_project/macros/get_custom_name/get_custom_schema.sql,sha256=2
|
|
|
86
86
|
dbt/include/global_project/macros/materializations/configs.sql,sha256=aciTDXFQoiAU4y8nsreTQnSca18P2tjURx-LQIrzyuc,627
|
|
87
87
|
dbt/include/global_project/macros/materializations/hooks.sql,sha256=IIOLRanrLtpYcWxWPaPJ7JMoyJdQJicEDni4yoE9mJI,994
|
|
88
88
|
dbt/include/global_project/macros/materializations/models/materialized_view.sql,sha256=-u0cGQrHEMBt8coXfKKPpUQJS97TX3QRafV873fqeCA,5029
|
|
89
|
-
dbt/include/global_project/macros/materializations/models/table.sql,sha256=
|
|
89
|
+
dbt/include/global_project/macros/materializations/models/table.sql,sha256=F9ogmZofhPdzKwhhFJ_GfI5QRXQxLjTl6xTiCgulQ9g,2682
|
|
90
90
|
dbt/include/global_project/macros/materializations/models/view.sql,sha256=LPqM3aTsWiAalFz322aTpqKqCdl4hxN8ubcwXZIIDDw,3249
|
|
91
91
|
dbt/include/global_project/macros/materializations/models/clone/can_clone_table.sql,sha256=YVq2f574IxMDuEv5rbaTvUpLLqc-jQfyOgBQJQGWcmk,187
|
|
92
92
|
dbt/include/global_project/macros/materializations/models/clone/clone.sql,sha256=X85U0zwq_OINxeZ7JDer9i3BgQZvgGM-tKTvITrQx5s,2716
|
|
93
93
|
dbt/include/global_project/macros/materializations/models/clone/create_or_replace_clone.sql,sha256=qr33DwFOpRG0wGVsGvr63-MexYMNZC9xKdGOPmICp_c,367
|
|
94
94
|
dbt/include/global_project/macros/materializations/models/incremental/column_helpers.sql,sha256=hslQlGKW0oW97srfugsFVRR-L6RrzRcnwr3uLhzI0X4,2577
|
|
95
|
-
dbt/include/global_project/macros/materializations/models/incremental/incremental.sql,sha256=
|
|
95
|
+
dbt/include/global_project/macros/materializations/models/incremental/incremental.sql,sha256=yOG-Rsv_j6JhGIHdfFk77_DoILFgFqsLN27R5LdCnZM,4546
|
|
96
96
|
dbt/include/global_project/macros/materializations/models/incremental/is_incremental.sql,sha256=Sm1TqOeqcCQofj3REFcA97yukPB1J_mClDd55r5GewE,478
|
|
97
97
|
dbt/include/global_project/macros/materializations/models/incremental/merge.sql,sha256=hrOgfAE3Aam0srudb0CgHZaAUFBnIXMAndoOncYP3T8,4840
|
|
98
98
|
dbt/include/global_project/macros/materializations/models/incremental/on_schema_change.sql,sha256=EOgcrYhwOGVPnyaBu7kIfe8LTOYVOu-AhxMtBs8ETpQ,4927
|
|
@@ -163,7 +163,7 @@ dbt/include/global_project/macros/utils/right.sql,sha256=EwNG98CAFIwNDmarwopf7Rk
|
|
|
163
163
|
dbt/include/global_project/macros/utils/safe_cast.sql,sha256=1mswwkDACmIi1I99JKb_-vq3kjMe4HhMRV70mW8Bt4Y,298
|
|
164
164
|
dbt/include/global_project/macros/utils/split_part.sql,sha256=fXEIS0oIiYR7-4lYbb0QbZdG-q2TpV63AFd1ky4I5UM,714
|
|
165
165
|
dbt/include/global_project/tests/generic/builtin.sql,sha256=p94xdyPwb2TlxgLBqCfrcRfJ1QNgsjPvBm8f0Q5eqZM,1022
|
|
166
|
-
dbt_adapters-1.14.
|
|
167
|
-
dbt_adapters-1.14.
|
|
168
|
-
dbt_adapters-1.14.
|
|
169
|
-
dbt_adapters-1.14.
|
|
166
|
+
dbt_adapters-1.14.6.dist-info/METADATA,sha256=ksElgHSEL9CpN0wEAmwnHPZMLjitT4rQ6dtRAmsNwj4,4494
|
|
167
|
+
dbt_adapters-1.14.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
168
|
+
dbt_adapters-1.14.6.dist-info/licenses/LICENSE,sha256=9yjigiJhWcCZvQjdagGKDwrRph58QWc5P2bVSQwXo6s,11344
|
|
169
|
+
dbt_adapters-1.14.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|