sqlmesh 0.203.1.dev10__py3-none-any.whl → 0.204.1.dev1__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.
sqlmesh/_version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.203.1.dev10'
21
- __version_tuple__ = version_tuple = (0, 203, 1, 'dev10')
20
+ __version__ = version = '0.204.1.dev1'
21
+ __version_tuple__ = version_tuple = (0, 204, 1, 'dev1')
@@ -601,7 +601,7 @@ class PlanBuilder:
601
601
  # If the model kind changes mark as breaking
602
602
  if snapshot.is_model and snapshot.name in self._context_diff.modified_snapshots:
603
603
  _, old = self._context_diff.modified_snapshots[snapshot.name]
604
- if old.model.kind.name != snapshot.model.kind.name:
604
+ if _is_breaking_kind_change(old, snapshot):
605
605
  category = SnapshotChangeCategory.BREAKING
606
606
 
607
607
  snapshot.categorize_as(category)
@@ -765,8 +765,8 @@ class PlanBuilder:
765
765
  snapshot = self._context_diff.snapshots[s_id]
766
766
  if snapshot.name in self._context_diff.modified_snapshots:
767
767
  _, old = self._context_diff.modified_snapshots[snapshot.name]
768
- # If the model kind has changed, then we should not consider this to be a forward-only change.
769
- if snapshot.is_model and old.model.kind.name != snapshot.model.kind.name:
768
+ # If the model kind has changed in a breaking way, then we can't consider this to be a forward-only change.
769
+ if snapshot.is_model and _is_breaking_kind_change(old, snapshot):
770
770
  return False
771
771
  return (
772
772
  snapshot.is_model
@@ -882,3 +882,16 @@ class PlanBuilder:
882
882
  if snapshot.name in self._context_diff.modified_snapshots
883
883
  or snapshot.snapshot_id in self._context_diff.added
884
884
  ]
885
+
886
+
887
+ def _is_breaking_kind_change(old: Snapshot, new: Snapshot) -> bool:
888
+ if old.model.kind.name == new.model.kind.name:
889
+ # If the kind hasn't changed, then it's not a breaking change
890
+ return False
891
+ if not old.is_incremental or not new.is_incremental:
892
+ # If either is not incremental, then it's a breaking change
893
+ return True
894
+ if old.model.partitioned_by == new.model.partitioned_by:
895
+ # If the partitioning hasn't changed, then it's not a breaking change
896
+ return False
897
+ return True
sqlmesh/dbt/model.py CHANGED
@@ -257,6 +257,13 @@ class ModelConfig(BaseModelConfig):
257
257
  if field_val is not None:
258
258
  incremental_by_kind_kwargs[field] = field_val
259
259
 
260
+ disable_restatement = self.disable_restatement
261
+ if disable_restatement is None:
262
+ disable_restatement = (
263
+ not self.full_refresh if self.full_refresh is not None else False
264
+ )
265
+ incremental_kind_kwargs["disable_restatement"] = disable_restatement
266
+
260
267
  if self.time_column:
261
268
  strategy = self.incremental_strategy or target.default_incremental_strategy(
262
269
  IncrementalByTimeRangeKind
@@ -270,20 +277,11 @@ class ModelConfig(BaseModelConfig):
270
277
 
271
278
  return IncrementalByTimeRangeKind(
272
279
  time_column=self.time_column,
273
- disable_restatement=(
274
- self.disable_restatement if self.disable_restatement is not None else False
275
- ),
276
280
  auto_restatement_intervals=self.auto_restatement_intervals,
277
281
  **incremental_kind_kwargs,
278
282
  **incremental_by_kind_kwargs,
279
283
  )
280
284
 
281
- disable_restatement = self.disable_restatement
282
- if disable_restatement is None:
283
- disable_restatement = (
284
- not self.full_refresh if self.full_refresh is not None else False
285
- )
286
-
287
285
  if self.unique_key:
288
286
  strategy = self.incremental_strategy or target.default_incremental_strategy(
289
287
  IncrementalByUniqueKeyKind
@@ -309,7 +307,6 @@ class ModelConfig(BaseModelConfig):
309
307
 
310
308
  return IncrementalByUniqueKeyKind(
311
309
  unique_key=self.unique_key,
312
- disable_restatement=disable_restatement,
313
310
  **incremental_kind_kwargs,
314
311
  **incremental_by_kind_kwargs,
315
312
  )
@@ -319,7 +316,6 @@ class ModelConfig(BaseModelConfig):
319
316
  )
320
317
  return IncrementalUnmanagedKind(
321
318
  insert_overwrite=strategy in INCREMENTAL_BY_TIME_STRATEGIES,
322
- disable_restatement=disable_restatement,
323
319
  **incremental_kind_kwargs,
324
320
  )
325
321
  if materialization == Materialization.EPHEMERAL:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlmesh
3
- Version: 0.203.1.dev10
3
+ Version: 0.204.1.dev1
4
4
  Summary: Next-generation data transformation framework
5
5
  Author-email: "TobikoData Inc." <engineering@tobikodata.com>
6
6
  License: Apache License
@@ -1,5 +1,5 @@
1
1
  sqlmesh/__init__.py,sha256=QjwaamJIdW7voXoS880yAx7tHm-Im4_mqGA-XJgafos,7631
2
- sqlmesh/_version.py,sha256=Pqu3e3NrlM2FLiXWJoxnWZGbdatWTkrCxCS6p5vc8kQ,530
2
+ sqlmesh/_version.py,sha256=N7I-OPUT2Y2sIHKTmhnjQezvcpM9fvtH13-f6vPNzI0,528
3
3
  sqlmesh/magics.py,sha256=bEzYqXHcM0P3CjyUZ1O9arlmXAdLAhoglKbQ29fD9AE,41842
4
4
  sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -94,7 +94,7 @@ sqlmesh/core/model/meta.py,sha256=D9InI9M2-IXeb34vkXNQSLALL8xVXjZ_LXwI-Tqxm7I,21
94
94
  sqlmesh/core/model/schema.py,sha256=_HMYfzK9wWXh7_CQDIIGnuQUD4aiX3o5D2cRp2sERzc,3387
95
95
  sqlmesh/core/model/seed.py,sha256=a0M-1zY1gOkN5ph2GQyataEdBSCtq50YjeFk2LyvInI,5058
96
96
  sqlmesh/core/plan/__init__.py,sha256=NKSvM7ZBVjw9ho3J65M1wFvG3KURB8PJ0FHHLmtSF44,443
97
- sqlmesh/core/plan/builder.py,sha256=TQVSGiGbQi9tro0tBlcL2f5BEvyOYNiLuB3yz8PRUzA,41859
97
+ sqlmesh/core/plan/builder.py,sha256=aj-4jDXy7Uk2apMClBNiR_d317PVURhF3XTt5MN-KeA,42389
98
98
  sqlmesh/core/plan/definition.py,sha256=yrX_uZMXi29ltkuowWhNUOi1kd0Uq0TQoM574EI6JHo,14019
99
99
  sqlmesh/core/plan/evaluator.py,sha256=0oqepq0qZ_tPhAye6Q9gLenBD_8yE3E8AAwt553lz7U,22163
100
100
  sqlmesh/core/plan/explainer.py,sha256=aBkvtM9eog_2NIglazSDdG_i9TTCdFSVOkCw5N8O-1k,12028
@@ -132,7 +132,7 @@ sqlmesh/dbt/common.py,sha256=g4PAL-sEdlnfb_zT-WW3xh-oamyCUoK8dUiDEMVwDWI,7804
132
132
  sqlmesh/dbt/context.py,sha256=dxClM-G1IeMbP0v5yxC_va8QNU-uKghW2dBlSZHJOk0,10331
133
133
  sqlmesh/dbt/loader.py,sha256=EqPcPT-RgLo52iMiDc9eUb8tWrsvdR8RoRJG06FStBw,15576
134
134
  sqlmesh/dbt/manifest.py,sha256=jlafUYdoG7gS2pzvJrt9JfC2afbAMORhBbBUaLl-ZTM,24894
135
- sqlmesh/dbt/model.py,sha256=FgQpl8pUNOnihGUo5PYdqOqqOX3XtfDHX3xEJc-CVC4,25782
135
+ sqlmesh/dbt/model.py,sha256=Ix-IYFEaUFzhTvs-Rz2EtVA6cEGJAyhgI03M1DQ5Kek,25580
136
136
  sqlmesh/dbt/package.py,sha256=IBBQueVB4_4C9tIk0-GUL-O2uibNxXu6W2a4AeHHcOU,4322
137
137
  sqlmesh/dbt/profile.py,sha256=Fz2c0dJNN0xBgYEogCIKBTByjNvlA2BVBzOLQCfdEfM,3788
138
138
  sqlmesh/dbt/project.py,sha256=a21czHhdcm2J80Zllj2q6VvH-W_rDtlXHa8wmvHaLTo,4036
@@ -285,7 +285,7 @@ sqlmesh/utils/pydantic.py,sha256=o_NsXbIpDqNpUA1Uc5xF0ZzoXQYYB0DfHwdRxBwXPNk,120
285
285
  sqlmesh/utils/rich.py,sha256=cwQ5nJ6sgz64xHtoh6_ec7ReV5YpsOGhMtUJnwoRfEI,3549
286
286
  sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
287
287
  sqlmesh/utils/yaml.py,sha256=hvo5lmybYLcIx4p6CQwufS8X4MbwS60lEBnCmYJCXmU,2336
288
- sqlmesh-0.203.1.dev10.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
288
+ sqlmesh-0.204.1.dev1.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
289
289
  web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
290
290
  web/client/dist/index.html,sha256=SXykdSRNgrT1k6I2dPZPEfpxPjIsi8-yVFijt-naSA4,5472
291
291
  web/client/dist/assets/Audits-Jm353fhk.js,sha256=ry6b5IKT3hLAfD5C3T2BqxulfauEV0n0YZ2vsP4eQ_U,1041
@@ -403,8 +403,8 @@ web/server/api/endpoints/models.py,sha256=kwj0s7uve3iZSMfmjkoPVMFMeY1sD0peTeyrWf
403
403
  web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
404
404
  web/server/api/endpoints/plan.py,sha256=bbbY50W_2MsZSTxOHWMKz0tbIm75nsRSlPy8GI2fg9Q,9306
405
405
  web/server/api/endpoints/table_diff.py,sha256=SCy3-pr5x6bEEiOaZGCDbiHQhpgxwmnz3Acqa2Ie6jI,2090
406
- sqlmesh-0.203.1.dev10.dist-info/METADATA,sha256=_TPgqKAKXoI1Vjnfa-RzX9fcC3euRm6KKDPTvyG4J_E,26679
407
- sqlmesh-0.203.1.dev10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
408
- sqlmesh-0.203.1.dev10.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
409
- sqlmesh-0.203.1.dev10.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
410
- sqlmesh-0.203.1.dev10.dist-info/RECORD,,
406
+ sqlmesh-0.204.1.dev1.dist-info/METADATA,sha256=zuD3BDGxUDgJqj0KEofArDX7smm7uKLXyDoi5EnW6fg,26678
407
+ sqlmesh-0.204.1.dev1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
408
+ sqlmesh-0.204.1.dev1.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
409
+ sqlmesh-0.204.1.dev1.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
410
+ sqlmesh-0.204.1.dev1.dist-info/RECORD,,