dbt-adapters 1.5.0__py3-none-any.whl → 1.6.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 CHANGED
@@ -1 +1 @@
1
- version = "1.5.0"
1
+ version = "1.6.0"
dbt/adapters/base/impl.py CHANGED
@@ -55,7 +55,7 @@ from dbt.adapters.base.connections import (
55
55
  BaseConnectionManager,
56
56
  Connection,
57
57
  )
58
- from dbt.adapters.base.meta import AdapterMeta, available
58
+ from dbt.adapters.base.meta import AdapterMeta, available, available_property
59
59
  from dbt.adapters.base.relation import (
60
60
  BaseRelation,
61
61
  ComponentName,
@@ -272,7 +272,8 @@ class BaseAdapter(metaclass=AdapterMeta):
272
272
  self.connections = self.ConnectionManager(config, mp_context)
273
273
  self._macro_resolver: Optional[MacroResolverProtocol] = None
274
274
  self._macro_context_generator: Optional[MacroContextGeneratorCallable] = None
275
- self.behavior = [] # this will be updated to include global behavior flags once they exist
275
+ # this will be updated to include global behavior flags once they exist
276
+ self.behavior = [] # type: ignore
276
277
 
277
278
  ###
278
279
  # Methods to set / access a macro resolver
@@ -293,11 +294,11 @@ class BaseAdapter(metaclass=AdapterMeta):
293
294
  ) -> None:
294
295
  self._macro_context_generator = macro_context_generator
295
296
 
296
- @property
297
+ @available_property
297
298
  def behavior(self) -> Behavior:
298
299
  return self._behavior
299
300
 
300
- @behavior.setter
301
+ @behavior.setter # type: ignore
301
302
  def behavior(self, flags: List[BehaviorFlag]) -> None:
302
303
  flags.extend(self._behavior_flags)
303
304
  try:
@@ -1572,7 +1573,7 @@ class BaseAdapter(metaclass=AdapterMeta):
1572
1573
  return ["append"]
1573
1574
 
1574
1575
  def builtin_incremental_strategies(self):
1575
- return ["append", "delete+insert", "merge", "insert_overwrite"]
1576
+ return ["append", "delete+insert", "merge", "insert_overwrite", "microbatch"]
1576
1577
 
1577
1578
  @available.parse_none
1578
1579
  def get_incremental_strategy_macro(self, model_context, strategy: str):
dbt/adapters/base/meta.py CHANGED
@@ -92,6 +92,25 @@ class _Available:
92
92
  available = _Available()
93
93
 
94
94
 
95
+ class available_property(property):
96
+ """
97
+ This supports making dynamic properties (`@property`) available in the jinja context.
98
+
99
+ We use `@available` to make methods available in the jinja context, but this mechanism relies on the method being callable.
100
+ Intuitively, we should be able to use both `@available` and `@property` to create a dynamic property that's available in the jinja context.
101
+
102
+ Using the `@property` decorator as the inner decorator supplies `@available` with something that is not callable.
103
+ Instead of returning the method, `@property` returns the value itself, not the method that is called to create the value.
104
+
105
+ Using the `@available` decorator as the inner decorator adds `_is_available_ = True` to the function.
106
+ However, when the `@property` decorator executes, it returns a `property` object which does not have the `_is_available_` attribute.
107
+
108
+ This decorator solves this problem by simply adding `_is_available_ = True` as an attribute on the `property` built-in.
109
+ """
110
+
111
+ _is_available_ = True
112
+
113
+
95
114
  class AdapterMeta(abc.ABCMeta):
96
115
  _available_: FrozenSet[str]
97
116
  _parse_replacements_: Dict[str, Callable]
@@ -37,8 +37,8 @@ Self = TypeVar("Self", bound="BaseRelation")
37
37
  SerializableIterable = Union[Tuple, FrozenSet]
38
38
 
39
39
 
40
- @dataclass(frozen=True, eq=False, repr=False)
41
- class EventTimeFilter(FakeAPIObject, Hashable):
40
+ @dataclass
41
+ class EventTimeFilter(FakeAPIObject):
42
42
  field_name: str
43
43
  start: Optional[datetime] = None
44
44
  end: Optional[datetime] = None
@@ -66,6 +66,19 @@
66
66
  {% endmacro %}
67
67
 
68
68
 
69
+ {% macro get_incremental_microbatch_sql(arg_dict) %}
70
+
71
+ {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}
72
+
73
+ {% endmacro %}
74
+
75
+ {% macro default__get_incremental_microbatch_sql(arg_dict) %}
76
+
77
+ {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}
78
+
79
+ {% endmacro %}
80
+
81
+
69
82
  {% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}
70
83
 
71
84
  {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute="name")) -%}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dbt-adapters
3
- Version: 1.5.0
3
+ Version: 1.6.0
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
6
6
  Project-URL: Documentation, https://docs.getdbt.com
@@ -1,5 +1,5 @@
1
1
  dbt/__init__.py,sha256=iY4jdvOxcDhkdr5FiyOTZPHadKtMZDQ-qC6Fw6_EHPM,277
2
- dbt/adapters/__about__.py,sha256=Wgohrh7g_peUNIz0Cro4w7u88rZU94fNypIcm9oMWgQ,18
2
+ dbt/adapters/__about__.py,sha256=x8UFKPUEuSXMhqiFugvE43AvVf31jatg5kxfn9Lf_Po,18
3
3
  dbt/adapters/__init__.py,sha256=3noHsg-64qI0_Pw6OR9F7l1vU2_qrJvinq8POTtuaZM,252
4
4
  dbt/adapters/cache.py,sha256=WGy4ewnz-J13LverTACBW2iFhGswrWLgm-wiBrQnMzo,20084
5
5
  dbt/adapters/capability.py,sha256=-Mbej2AL_bjQatHpFWUgsQ8z0zwnotyE9Y5DYHnX7NE,2364
@@ -12,11 +12,11 @@ dbt/adapters/base/README.md,sha256=muHQntC07Lh6L1XfVgwKhV5RltOPBLYPdQqd8_7l34c,5
12
12
  dbt/adapters/base/__init__.py,sha256=KGGGbj8jGMjAFJdQ5YHcOpApMMVZ_6Xuni1swhpkqRY,423
13
13
  dbt/adapters/base/column.py,sha256=Uj20UixoxCn2rlv4QDNONyys6CDkDFyG3anCXKf0T2c,5350
14
14
  dbt/adapters/base/connections.py,sha256=-C5dOwGgMKH8n_v6wjwOxV7chBdS0GjOGwNQCUbhhWc,16951
15
- dbt/adapters/base/impl.py,sha256=WIYEIX_RhB3C4R1nkSjVuOaBQggYXwI0Tlovlinn30o,70444
16
- dbt/adapters/base/meta.py,sha256=MMqL2xBqdvoacNs9JcL0E38NZIhCP4RH4OD_z_jo7GQ,4644
15
+ dbt/adapters/base/impl.py,sha256=SxYJiwG_9BZQw32LeKd5GqQH7rDM8ClaE3E1EHj7aV4,70527
16
+ dbt/adapters/base/meta.py,sha256=IKqviGf7gK_qGtrn0t8NaSdUaw8g_M8SjICacMvNwGY,5702
17
17
  dbt/adapters/base/plugin.py,sha256=rm0GjNHnWM2mn0GJOjciZLwn-02xlzWCoMT9u-epwP0,1076
18
18
  dbt/adapters/base/query_headers.py,sha256=UluGd9IYCYkoMiDi5Yx_lnrCOSjWppjwRro4SIGgx8I,3496
19
- dbt/adapters/base/relation.py,sha256=96IbXN1j9w8fZkcojCkJwFaMMMdv74VRoSFVQqkUPK0,18409
19
+ dbt/adapters/base/relation.py,sha256=MhwrOGOv6DeijeFy6n61PNdVsa6ZDOMHwwQqIMXYn-Y,18364
20
20
  dbt/adapters/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  dbt/adapters/clients/jinja.py,sha256=NsZOiBpOLunS46hRL5OcX1MpY3Ih6_87Vgz4qd_PNbc,768
22
22
  dbt/adapters/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -91,7 +91,7 @@ dbt/include/global_project/macros/materializations/models/incremental/incrementa
91
91
  dbt/include/global_project/macros/materializations/models/incremental/is_incremental.sql,sha256=Sm1TqOeqcCQofj3REFcA97yukPB1J_mClDd55r5GewE,478
92
92
  dbt/include/global_project/macros/materializations/models/incremental/merge.sql,sha256=Xg5-Gc9jHego-wpdfg6yEIQv7EClz6-xcJEeFXuZiwQ,5197
93
93
  dbt/include/global_project/macros/materializations/models/incremental/on_schema_change.sql,sha256=EOgcrYhwOGVPnyaBu7kIfe8LTOYVOu-AhxMtBs8ETpQ,4927
94
- dbt/include/global_project/macros/materializations/models/incremental/strategies.sql,sha256=1QKXoCm47g_JAmWypjSUHU8ACmXFgaBoWUG3HPCN7wA,2251
94
+ dbt/include/global_project/macros/materializations/models/incremental/strategies.sql,sha256=ORGWiYfj-b3_VIps9FDlyx-Q4A2hZzX2aYLocW8b6pU,2613
95
95
  dbt/include/global_project/macros/materializations/seeds/helpers.sql,sha256=Y15ej-D3gm1ExIOMNT208q43gRk8d985WQBuGSooNL0,3920
96
96
  dbt/include/global_project/macros/materializations/seeds/seed.sql,sha256=YSoGzVO3iIUiOKIUM9G7yApGLFH4O9bv_d4KjHo3p4Q,2155
97
97
  dbt/include/global_project/macros/materializations/snapshots/helpers.sql,sha256=rLnopom7nEzbQ12C9O9yIMh4C8poshYqlVTnmE4gLh0,6012
@@ -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.5.0.dist-info/METADATA,sha256=rVUPUa1VjVs3l8j2Ur7mQa7ROHwhE3w4-Ok0dCZyIn8,2547
161
- dbt_adapters-1.5.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
162
- dbt_adapters-1.5.0.dist-info/licenses/LICENSE,sha256=9yjigiJhWcCZvQjdagGKDwrRph58QWc5P2bVSQwXo6s,11344
163
- dbt_adapters-1.5.0.dist-info/RECORD,,
160
+ dbt_adapters-1.6.0.dist-info/METADATA,sha256=U_VNpaFe2HNhS7AnTf2MhcgU2HUHv9Iui_N6NRCqNSw,2547
161
+ dbt_adapters-1.6.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
162
+ dbt_adapters-1.6.0.dist-info/licenses/LICENSE,sha256=9yjigiJhWcCZvQjdagGKDwrRph58QWc5P2bVSQwXo6s,11344
163
+ dbt_adapters-1.6.0.dist-info/RECORD,,