sqlmesh 0.187.6.dev20__py3-none-any.whl → 0.187.6.dev22__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 +2 -2
- sqlmesh/core/context.py +0 -2
- sqlmesh/core/plan/builder.py +6 -5
- sqlmesh/core/schema_diff.py +22 -0
- {sqlmesh-0.187.6.dev20.dist-info → sqlmesh-0.187.6.dev22.dist-info}/METADATA +1 -1
- {sqlmesh-0.187.6.dev20.dist-info → sqlmesh-0.187.6.dev22.dist-info}/RECORD +10 -10
- {sqlmesh-0.187.6.dev20.dist-info → sqlmesh-0.187.6.dev22.dist-info}/WHEEL +0 -0
- {sqlmesh-0.187.6.dev20.dist-info → sqlmesh-0.187.6.dev22.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.187.6.dev20.dist-info → sqlmesh-0.187.6.dev22.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.187.6.dev20.dist-info → sqlmesh-0.187.6.dev22.dist-info}/top_level.txt +0 -0
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.187.6.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 187, 6, '
|
|
20
|
+
__version__ = version = '0.187.6.dev22'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 187, 6, 'dev22')
|
sqlmesh/core/context.py
CHANGED
|
@@ -93,7 +93,6 @@ from sqlmesh.core.plan import Plan, PlanBuilder, SnapshotIntervals
|
|
|
93
93
|
from sqlmesh.core.plan.definition import UserProvidedFlags
|
|
94
94
|
from sqlmesh.core.reference import ReferenceGraph
|
|
95
95
|
from sqlmesh.core.scheduler import Scheduler, CompletionStatus
|
|
96
|
-
from sqlmesh.core.schema_diff import SchemaDiffer
|
|
97
96
|
from sqlmesh.core.schema_loader import create_external_models_file
|
|
98
97
|
from sqlmesh.core.selector import Selector
|
|
99
98
|
from sqlmesh.core.snapshot import (
|
|
@@ -1541,7 +1540,6 @@ class GenericContext(BaseContext, t.Generic[C]):
|
|
|
1541
1540
|
),
|
|
1542
1541
|
end_bounded=not run,
|
|
1543
1542
|
ensure_finalized_snapshots=self.config.plan.use_finalized_state,
|
|
1544
|
-
engine_schema_differ=SchemaDiffer(), # TODO: fix to properly handle it
|
|
1545
1543
|
interval_end_per_model=max_interval_end_per_model,
|
|
1546
1544
|
console=self.console,
|
|
1547
1545
|
user_provided_flags=user_provided_flags,
|
sqlmesh/core/plan/builder.py
CHANGED
|
@@ -21,7 +21,11 @@ from sqlmesh.core.plan.definition import (
|
|
|
21
21
|
UserProvidedFlags,
|
|
22
22
|
earliest_interval_start,
|
|
23
23
|
)
|
|
24
|
-
from sqlmesh.core.schema_diff import
|
|
24
|
+
from sqlmesh.core.schema_diff import (
|
|
25
|
+
get_schema_differ,
|
|
26
|
+
has_drop_alteration,
|
|
27
|
+
get_dropped_column_names,
|
|
28
|
+
)
|
|
25
29
|
from sqlmesh.core.snapshot import (
|
|
26
30
|
DeployabilityIndex,
|
|
27
31
|
Snapshot,
|
|
@@ -78,14 +82,12 @@ class PlanBuilder:
|
|
|
78
82
|
ensure_finalized_snapshots: Whether to compare against snapshots from the latest finalized
|
|
79
83
|
environment state, or to use whatever snapshots are in the current environment state even if
|
|
80
84
|
the environment is not finalized.
|
|
81
|
-
engine_schema_differ: Schema differ from the context engine adapter.
|
|
82
85
|
interval_end_per_model: The mapping from model FQNs to target end dates.
|
|
83
86
|
"""
|
|
84
87
|
|
|
85
88
|
def __init__(
|
|
86
89
|
self,
|
|
87
90
|
context_diff: ContextDiff,
|
|
88
|
-
engine_schema_differ: SchemaDiffer,
|
|
89
91
|
start: t.Optional[TimeLike] = None,
|
|
90
92
|
end: t.Optional[TimeLike] = None,
|
|
91
93
|
execution_time: t.Optional[TimeLike] = None,
|
|
@@ -137,7 +139,6 @@ class PlanBuilder:
|
|
|
137
139
|
self._backfill_models = backfill_models
|
|
138
140
|
self._end = end or default_end
|
|
139
141
|
self._apply = apply
|
|
140
|
-
self._engine_schema_differ = engine_schema_differ
|
|
141
142
|
self._console = console or get_console()
|
|
142
143
|
self._choices: t.Dict[SnapshotId, SnapshotChangeCategory] = {}
|
|
143
144
|
self._user_provided_flags = user_provided_flags
|
|
@@ -493,7 +494,7 @@ class PlanBuilder:
|
|
|
493
494
|
if columns_to_types_all_known(old_columns_to_types) and columns_to_types_all_known(
|
|
494
495
|
new_columns_to_types
|
|
495
496
|
):
|
|
496
|
-
schema_diff =
|
|
497
|
+
schema_diff = get_schema_differ(snapshot.model.dialect).compare_columns(
|
|
497
498
|
new.name,
|
|
498
499
|
old_columns_to_types,
|
|
499
500
|
new_columns_to_types,
|
sqlmesh/core/schema_diff.py
CHANGED
|
@@ -723,5 +723,27 @@ def get_dropped_column_names(alter_expressions: t.List[exp.Alter]) -> t.List[str
|
|
|
723
723
|
return dropped_columns
|
|
724
724
|
|
|
725
725
|
|
|
726
|
+
def get_schema_differ(dialect: str) -> SchemaDiffer:
|
|
727
|
+
"""
|
|
728
|
+
Returns the appropriate SchemaDiffer for a given dialect without initializing the engine adapter.
|
|
729
|
+
|
|
730
|
+
Args:
|
|
731
|
+
dialect: The dialect for which to get the schema differ.
|
|
732
|
+
|
|
733
|
+
Returns:
|
|
734
|
+
The SchemaDiffer instance configured for the given dialect.
|
|
735
|
+
"""
|
|
736
|
+
from sqlmesh.core.engine_adapter import (
|
|
737
|
+
DIALECT_TO_ENGINE_ADAPTER,
|
|
738
|
+
DIALECT_ALIASES,
|
|
739
|
+
EngineAdapter,
|
|
740
|
+
)
|
|
741
|
+
|
|
742
|
+
dialect = dialect.lower()
|
|
743
|
+
dialect = DIALECT_ALIASES.get(dialect, dialect)
|
|
744
|
+
engine_adapter_class = DIALECT_TO_ENGINE_ADAPTER.get(dialect, EngineAdapter)
|
|
745
|
+
return getattr(engine_adapter_class, "SCHEMA_DIFFER", SchemaDiffer())
|
|
746
|
+
|
|
747
|
+
|
|
726
748
|
def _get_name_and_type(struct: exp.ColumnDef) -> t.Tuple[exp.Identifier, exp.DataType]:
|
|
727
749
|
return struct.this, struct.args["kind"]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sqlmesh/__init__.py,sha256=69xw6bTmi4cW90M-sl3g6wLDgxVcLHcKg1q8GS3lqyA,7466
|
|
2
|
-
sqlmesh/_version.py,sha256=
|
|
2
|
+
sqlmesh/_version.py,sha256=cyQDrgx6_I-4MYrUqxMqW5JF15uktXuk_d0mE6HqX48,530
|
|
3
3
|
sqlmesh/magics.py,sha256=JHorAZNtezf123jmTyNSoUC9yHmv-08hMP205PJmmIo,39750
|
|
4
4
|
sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -13,7 +13,7 @@ sqlmesh/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
13
13
|
sqlmesh/core/_typing.py,sha256=e1f7xO2aZCy38M_3VoDy-XI3shyd99-IFctgIFSgXWM,497
|
|
14
14
|
sqlmesh/core/console.py,sha256=ZAaGLOWBJGBxPzLV7KZZ9akPExgD5m5AboCM8O0Q0nY,150944
|
|
15
15
|
sqlmesh/core/constants.py,sha256=oqt6zjepUhQoWlgapKn_HpG7Pu9mrFwepdX5caNfJUI,2499
|
|
16
|
-
sqlmesh/core/context.py,sha256=
|
|
16
|
+
sqlmesh/core/context.py,sha256=NChzs9wkkH228dLFzRBLILGV3U59yFGi5MLkmoHzE1U,116800
|
|
17
17
|
sqlmesh/core/context_diff.py,sha256=s9toP17d4tJfOpFH91LcjGK2CM64PVuB0MPkeFgF4hQ,20415
|
|
18
18
|
sqlmesh/core/dialect.py,sha256=fPTV517IOS0nWMxYznNNQnXkQkFFrPOSKe8ghsQ0o8A,49759
|
|
19
19
|
sqlmesh/core/environment.py,sha256=Fsih6WZ7Tx4ec0XIlmIIspUWcmijPNW5uHPRQSWuhA8,12315
|
|
@@ -25,7 +25,7 @@ sqlmesh/core/notification_target.py,sha256=PPGoDrgbRKxr27vJEu03XqNTQLYTw0ZF_b0yA
|
|
|
25
25
|
sqlmesh/core/reference.py,sha256=k7OSkLqTjPR8WJjNeFj0xAJ297nZUMgb_iTVwKRRKjc,4875
|
|
26
26
|
sqlmesh/core/renderer.py,sha256=KOr7rQ-RfWiS51cEj2fzdhxCrYbU0A5wNTGwKyeqLt4,26636
|
|
27
27
|
sqlmesh/core/scheduler.py,sha256=TB03rSvPyaPMRANOJq_O_cNXvu0fc5rVaDVC9olE5kg,34196
|
|
28
|
-
sqlmesh/core/schema_diff.py,sha256=
|
|
28
|
+
sqlmesh/core/schema_diff.py,sha256=Sp2MoqAngp-yTYevkLaf9jb26SuAdGXoZ54g5MjWowU,30516
|
|
29
29
|
sqlmesh/core/schema_loader.py,sha256=lvrI9k7hr1P4X4E6t3U-KrcuvdQuw0UdNlN90P2s52w,3563
|
|
30
30
|
sqlmesh/core/selector.py,sha256=wrjuHZsVwEgTOz14gTPe1h-LfYdUFqcFSk1I3t5qdew,12137
|
|
31
31
|
sqlmesh/core/signal.py,sha256=yVLXewYP6eH0vt-EwaIaI2WwHz6hWsVr-Kb2m4kP1FU,1353
|
|
@@ -93,7 +93,7 @@ sqlmesh/core/model/meta.py,sha256=osJgfSj6maIIdWAHzDVCkXXL--__gnKvqkzxM6Nuq6g,20
|
|
|
93
93
|
sqlmesh/core/model/schema.py,sha256=OClbAeA8LpW-IiSiLT_TlDWkEqmIIvSk0GXq8SWI-GQ,3443
|
|
94
94
|
sqlmesh/core/model/seed.py,sha256=ctUHH6CmeEnBVJyIAZznx0xJBm09W7VIZ-76Cfwfq28,5004
|
|
95
95
|
sqlmesh/core/plan/__init__.py,sha256=ctpnu9mK3uTujs0It8qRMqcj9GdObXDnvSgn4rD2zqc,450
|
|
96
|
-
sqlmesh/core/plan/builder.py,sha256=
|
|
96
|
+
sqlmesh/core/plan/builder.py,sha256=WM-jnBgViLSfnL2-nUdZH9dCkD6TkYUnRuO9TgD8DsQ,38329
|
|
97
97
|
sqlmesh/core/plan/definition.py,sha256=SI3zi2poPkKJKTZogYv60Q7eIOhksaAcFUcu-J2-XqI,13218
|
|
98
98
|
sqlmesh/core/plan/evaluator.py,sha256=RAHJgQoV5Y5SIG_pV2O_Bn0VFlD1yzMC0UrUU6eaB_E,26842
|
|
99
99
|
sqlmesh/core/snapshot/__init__.py,sha256=Z5HTetNCZGoKF1WAKXk4LWL9dc8EC8lwS2O4TtoBmt4,1317
|
|
@@ -270,7 +270,7 @@ sqlmesh/utils/pydantic.py,sha256=I898jAFqa3qU6lG2uPpRebVFncOUo8ZrLWM_R3K3DHU,116
|
|
|
270
270
|
sqlmesh/utils/rich.py,sha256=xNZyPCqEc4TAlJlsEthg-5eYUWpaizz0QjBzO7a1Yv4,1509
|
|
271
271
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
272
272
|
sqlmesh/utils/yaml.py,sha256=np-WVcwmwsKghCgAj1OBBMsK1SXSRn4wR-H37cGiFr8,2282
|
|
273
|
-
sqlmesh-0.187.6.
|
|
273
|
+
sqlmesh-0.187.6.dev22.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
274
274
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
275
275
|
web/client/dist/index.html,sha256=QCrd8nHWTCuy7MMEEE_LbZ6ZDibolg6ZqxYJPP5gKUo,5472
|
|
276
276
|
web/client/dist/assets/Audits-BXuLcNW7.js,sha256=lxUVw0RvpALIqtvriOnq9f9kzUf2_MmyzXXol-5ZHVQ,1041
|
|
@@ -388,8 +388,8 @@ web/server/api/endpoints/models.py,sha256=ud-lRwriyI_OYg9tZchrBgeiXELiRTLNEodraf
|
|
|
388
388
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
389
389
|
web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
|
|
390
390
|
web/server/api/endpoints/table_diff.py,sha256=Wd5YxeKbZB7AkrDvqFgvV9ZQlnKYOF1n5W_w2EHE_Zw,2085
|
|
391
|
-
sqlmesh-0.187.6.
|
|
392
|
-
sqlmesh-0.187.6.
|
|
393
|
-
sqlmesh-0.187.6.
|
|
394
|
-
sqlmesh-0.187.6.
|
|
395
|
-
sqlmesh-0.187.6.
|
|
391
|
+
sqlmesh-0.187.6.dev22.dist-info/METADATA,sha256=0ufKLka_kfW3tMD7MCbqAryj6obCPCO2GX7nu6jAm6I,26494
|
|
392
|
+
sqlmesh-0.187.6.dev22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
393
|
+
sqlmesh-0.187.6.dev22.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
394
|
+
sqlmesh-0.187.6.dev22.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
395
|
+
sqlmesh-0.187.6.dev22.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|