sqlmesh 0.200.1.dev20__py3-none-any.whl → 0.200.1.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 +9 -0
- sqlmesh/core/test/context.py +2 -2
- sqlmesh/integrations/github/cicd/config.py +9 -0
- sqlmesh/integrations/github/cicd/controller.py +36 -0
- {sqlmesh-0.200.1.dev20.dist-info → sqlmesh-0.200.1.dev22.dist-info}/METADATA +1 -1
- {sqlmesh-0.200.1.dev20.dist-info → sqlmesh-0.200.1.dev22.dist-info}/RECORD +11 -11
- {sqlmesh-0.200.1.dev20.dist-info → sqlmesh-0.200.1.dev22.dist-info}/WHEEL +0 -0
- {sqlmesh-0.200.1.dev20.dist-info → sqlmesh-0.200.1.dev22.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.200.1.dev20.dist-info → sqlmesh-0.200.1.dev22.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.200.1.dev20.dist-info → sqlmesh-0.200.1.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.200.1.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 200, 1, '
|
|
20
|
+
__version__ = version = '0.200.1.dev22'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 200, 1, 'dev22')
|
sqlmesh/core/context.py
CHANGED
|
@@ -214,6 +214,15 @@ class BaseContext(abc.ABC):
|
|
|
214
214
|
"""
|
|
215
215
|
model_name = normalize_model_name(model_name, self.default_catalog, self.default_dialect)
|
|
216
216
|
|
|
217
|
+
if model_name not in self._model_tables:
|
|
218
|
+
model_name_list = "\n".join(list(self._model_tables))
|
|
219
|
+
logger.debug(
|
|
220
|
+
f"'{model_name}' not found in model to table mapping. Available model names: \n{model_name_list}"
|
|
221
|
+
)
|
|
222
|
+
raise SQLMeshError(
|
|
223
|
+
f"Unable to find a table mapping for model '{model_name}'. Has it been spelled correctly?"
|
|
224
|
+
)
|
|
225
|
+
|
|
217
226
|
# We generate SQL for the default dialect because the table name may be used in a
|
|
218
227
|
# fetchdf call and so the quotes need to be correct (eg. backticks for bigquery)
|
|
219
228
|
return parse_one(self._model_tables[model_name]).sql(
|
sqlmesh/core/test/context.py
CHANGED
|
@@ -43,8 +43,8 @@ class TestExecutionContext(ExecutionContext):
|
|
|
43
43
|
# Include upstream dependencies to ensure they can be resolved during test execution
|
|
44
44
|
return {
|
|
45
45
|
name: self._test._test_fixture_table(name).sql()
|
|
46
|
-
for model in self._models.
|
|
47
|
-
for name in [
|
|
46
|
+
for normalized_model_name, model in self._models.items()
|
|
47
|
+
for name in [normalized_model_name, *model.depends_on]
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
def with_variables(
|
|
@@ -33,6 +33,9 @@ class GithubCICDBotConfig(BaseConfig):
|
|
|
33
33
|
pr_environment_name: t.Optional[str] = None
|
|
34
34
|
pr_min_intervals: t.Optional[int] = None
|
|
35
35
|
prod_branch_names_: t.Optional[str] = Field(default=None, alias="prod_branch_name")
|
|
36
|
+
forward_only_branch_suffix_: t.Optional[str] = Field(
|
|
37
|
+
default=None, alias="forward_only_branch_suffix"
|
|
38
|
+
)
|
|
36
39
|
|
|
37
40
|
@model_validator(mode="before")
|
|
38
41
|
@classmethod
|
|
@@ -73,6 +76,10 @@ class GithubCICDBotConfig(BaseConfig):
|
|
|
73
76
|
return True
|
|
74
77
|
return self.skip_pr_backfill_
|
|
75
78
|
|
|
79
|
+
@property
|
|
80
|
+
def forward_only_branch_suffix(self) -> str:
|
|
81
|
+
return self.forward_only_branch_suffix_ or "-forward-only"
|
|
82
|
+
|
|
76
83
|
FIELDS_FOR_ANALYTICS: t.ClassVar[t.Set[str]] = {
|
|
77
84
|
"invalidate_environment_after_deploy",
|
|
78
85
|
"enable_deploy_command",
|
|
@@ -83,4 +90,6 @@ class GithubCICDBotConfig(BaseConfig):
|
|
|
83
90
|
"skip_pr_backfill",
|
|
84
91
|
"pr_include_unmodified",
|
|
85
92
|
"run_on_deploy_to_prod",
|
|
93
|
+
"pr_min_intervals",
|
|
94
|
+
"forward_only_branch_suffix",
|
|
86
95
|
}
|
|
@@ -405,6 +405,7 @@ class GithubController:
|
|
|
405
405
|
min_intervals=self.bot_config.pr_min_intervals,
|
|
406
406
|
skip_backfill=self.bot_config.skip_pr_backfill,
|
|
407
407
|
include_unmodified=self.bot_config.pr_include_unmodified,
|
|
408
|
+
forward_only=self.forward_only_plan,
|
|
408
409
|
)
|
|
409
410
|
assert self._pr_plan_builder
|
|
410
411
|
return self._pr_plan_builder.build()
|
|
@@ -434,6 +435,7 @@ class GithubController:
|
|
|
434
435
|
skip_linter=True,
|
|
435
436
|
categorizer_config=self.bot_config.auto_categorize_changes,
|
|
436
437
|
run=self.bot_config.run_on_deploy_to_prod,
|
|
438
|
+
forward_only=self.forward_only_plan,
|
|
437
439
|
)
|
|
438
440
|
assert self._prod_plan_builder
|
|
439
441
|
return self._prod_plan_builder.build()
|
|
@@ -450,6 +452,7 @@ class GithubController:
|
|
|
450
452
|
skip_tests=True,
|
|
451
453
|
skip_linter=True,
|
|
452
454
|
run=self.bot_config.run_on_deploy_to_prod,
|
|
455
|
+
forward_only=self.forward_only_plan,
|
|
453
456
|
)
|
|
454
457
|
assert self._prod_plan_with_gaps_builder
|
|
455
458
|
return self._prod_plan_with_gaps_builder.build()
|
|
@@ -473,6 +476,13 @@ class GithubController:
|
|
|
473
476
|
def pr_targets_prod_branch(self) -> bool:
|
|
474
477
|
return self._pull_request.base.ref in self.bot_config.prod_branch_names
|
|
475
478
|
|
|
479
|
+
@property
|
|
480
|
+
def forward_only_plan(self) -> bool:
|
|
481
|
+
head_ref = self._pull_request.head.ref
|
|
482
|
+
if isinstance(head_ref, str):
|
|
483
|
+
return head_ref.endswith(self.bot_config.forward_only_branch_suffix)
|
|
484
|
+
return False
|
|
485
|
+
|
|
476
486
|
@classmethod
|
|
477
487
|
def _append_output(cls, key: str, value: str) -> None:
|
|
478
488
|
"""
|
|
@@ -485,6 +495,26 @@ class GithubController:
|
|
|
485
495
|
with open(output_file, "a", encoding="utf-8") as fh:
|
|
486
496
|
print(f"{key}={value}", file=fh)
|
|
487
497
|
|
|
498
|
+
def get_forward_only_plan_post_deployment_tip(self, plan: Plan) -> str:
|
|
499
|
+
if not plan.forward_only:
|
|
500
|
+
return ""
|
|
501
|
+
|
|
502
|
+
example_model_name = "<model name>"
|
|
503
|
+
for snapshot_id in sorted(plan.snapshots):
|
|
504
|
+
snapshot = plan.snapshots[snapshot_id]
|
|
505
|
+
if snapshot.is_incremental:
|
|
506
|
+
example_model_name = snapshot.node.name
|
|
507
|
+
break
|
|
508
|
+
|
|
509
|
+
return (
|
|
510
|
+
"> [!TIP]\n"
|
|
511
|
+
"> In order to see this forward-only plan retroactively apply to historical intervals on the production model, run the below for date ranges in scope:\n"
|
|
512
|
+
"> \n"
|
|
513
|
+
f"> `$ sqlmesh plan --restate-model {example_model_name} --start YYYY-MM-DD --end YYYY-MM-DD`\n"
|
|
514
|
+
">\n"
|
|
515
|
+
"> Learn more: https://sqlmesh.readthedocs.io/en/stable/concepts/plans/?h=restate#restatement-plans"
|
|
516
|
+
)
|
|
517
|
+
|
|
488
518
|
def get_plan_summary(self, plan: Plan) -> str:
|
|
489
519
|
# use Verbosity.VERY_VERBOSE to prevent the list of models from being truncated
|
|
490
520
|
# this is particularly important for the "Models needing backfill" list because
|
|
@@ -754,6 +784,11 @@ class GithubController:
|
|
|
754
784
|
</details>
|
|
755
785
|
|
|
756
786
|
"""
|
|
787
|
+
if self.forward_only_plan:
|
|
788
|
+
plan_summary = (
|
|
789
|
+
f"{self.get_forward_only_plan_post_deployment_tip(self.prod_plan)}\n{plan_summary}"
|
|
790
|
+
)
|
|
791
|
+
|
|
757
792
|
self.update_sqlmesh_comment_info(
|
|
758
793
|
value=plan_summary,
|
|
759
794
|
dedup_regex=None,
|
|
@@ -1096,6 +1131,7 @@ class GithubController:
|
|
|
1096
1131
|
summary = "Got an action required conclusion but no plan error was provided. This is unexpected."
|
|
1097
1132
|
else:
|
|
1098
1133
|
summary = "**Generated Prod Plan**\n" + self.get_plan_summary(self.prod_plan)
|
|
1134
|
+
|
|
1099
1135
|
return conclusion, title, summary
|
|
1100
1136
|
|
|
1101
1137
|
self._update_check_handler(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sqlmesh/__init__.py,sha256=QjwaamJIdW7voXoS880yAx7tHm-Im4_mqGA-XJgafos,7631
|
|
2
|
-
sqlmesh/_version.py,sha256=
|
|
2
|
+
sqlmesh/_version.py,sha256=U0jhi_308MRKOqqM98agigj69adW1C-9rEu3C36oJ9w,530
|
|
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
|
|
@@ -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=GQAWuxK8KZl6UclgPM51upiZXag9u8h1-HKotzjvblA,163884
|
|
15
15
|
sqlmesh/core/constants.py,sha256=gUABXWYgH_XOSbaZAJsR5o1dmA61JDCvBDyxqqXX3LM,2630
|
|
16
|
-
sqlmesh/core/context.py,sha256=
|
|
16
|
+
sqlmesh/core/context.py,sha256=vH-wZOjyqyDDvYCdxeXOIEgBFo4jQXBGmIuSCCFmmN0,125223
|
|
17
17
|
sqlmesh/core/context_diff.py,sha256=_Ur55fGLJ58Icsp44I4pVhdi7_JHiHq45mWIco9oFzk,21792
|
|
18
18
|
sqlmesh/core/dialect.py,sha256=1ykYwb9WZn_nCaX08PcQ0BJh2Pihv9SPvoMNjpMeCfs,50158
|
|
19
19
|
sqlmesh/core/environment.py,sha256=odus40R-YzdQdS_IiUq_tFouUXIhnpwmNwo8dE8Aw1k,13041
|
|
@@ -118,7 +118,7 @@ sqlmesh/core/state_sync/db/snapshot.py,sha256=LV5w3hvwxa-v_ilC1iuQb4iAJDNoi9DH1a
|
|
|
118
118
|
sqlmesh/core/state_sync/db/utils.py,sha256=204OpT3ISFPCwWP9Aqq8nr6ETl24sbG5uOyo86IJv6E,3819
|
|
119
119
|
sqlmesh/core/state_sync/db/version.py,sha256=fl5g1tNMYu8O6WTN4J3bciwjGq0c5nZlRDlxxRKGU78,2210
|
|
120
120
|
sqlmesh/core/test/__init__.py,sha256=e83TJPwPRR_rAG29Y0OVbZb-5oWVBzz-_wrcd22Qk10,418
|
|
121
|
-
sqlmesh/core/test/context.py,sha256=
|
|
121
|
+
sqlmesh/core/test/context.py,sha256=9mmskKXpzsIkW_I31uN1n3Ioj8ngvyGAqyL_AZvVHpc,2253
|
|
122
122
|
sqlmesh/core/test/definition.py,sha256=FxrY-D7dFOkWFVXislLvMTD0ps62LjsXOV1Y20zpoUA,41536
|
|
123
123
|
sqlmesh/core/test/discovery.py,sha256=WXIwPidLoacAGHoT_3TVFFEKamG89nHNtaMsZ01uGjs,1188
|
|
124
124
|
sqlmesh/core/test/result.py,sha256=IIyR4uMDDFJ9Hf57iwrHgZ_W_tLwnr0KSWKeBJ0Pc6k,3961
|
|
@@ -161,8 +161,8 @@ sqlmesh/integrations/slack.py,sha256=nxLxu5WztGbZH3JdqnzyPqmJUMfRdJ_49LQ7zR-u39Q
|
|
|
161
161
|
sqlmesh/integrations/github/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
162
162
|
sqlmesh/integrations/github/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
163
163
|
sqlmesh/integrations/github/cicd/command.py,sha256=w3oWhvR4utEurB5UABXj4iVBIojkCnZ0wTazIFmVmnc,12246
|
|
164
|
-
sqlmesh/integrations/github/cicd/config.py,sha256=
|
|
165
|
-
sqlmesh/integrations/github/cicd/controller.py,sha256=
|
|
164
|
+
sqlmesh/integrations/github/cicd/config.py,sha256=n4KyNv65y1gpys82iLAQZUb6g2pnzywyV_7cOrQXsnI,3669
|
|
165
|
+
sqlmesh/integrations/github/cicd/controller.py,sha256=TseVIg_sRm39d_lSFIqaqDwWEnmJwNc8vg2Wf1Px9VU,54746
|
|
166
166
|
sqlmesh/lsp/api.py,sha256=_lA_buSPZFIoLJuINbS53LbNOOaHp3orb0uFTE3aCqI,2328
|
|
167
167
|
sqlmesh/lsp/completions.py,sha256=Nt1XpFL_-QAIRM8BBBC6Ia6YG0hMZriiNJra7nGfD4Q,6676
|
|
168
168
|
sqlmesh/lsp/context.py,sha256=szHCrmKAjg4wDRnSbjRU158wSGx9HBRnNswSNw9N0Qc,12439
|
|
@@ -284,7 +284,7 @@ sqlmesh/utils/pydantic.py,sha256=o_NsXbIpDqNpUA1Uc5xF0ZzoXQYYB0DfHwdRxBwXPNk,120
|
|
|
284
284
|
sqlmesh/utils/rich.py,sha256=BpB47G0-JcU41LkGkeGKroexj4NOV5fox4-GOIXPgIc,3545
|
|
285
285
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
286
286
|
sqlmesh/utils/yaml.py,sha256=hvo5lmybYLcIx4p6CQwufS8X4MbwS60lEBnCmYJCXmU,2336
|
|
287
|
-
sqlmesh-0.200.1.
|
|
287
|
+
sqlmesh-0.200.1.dev22.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
288
288
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
289
289
|
web/client/dist/index.html,sha256=DAv6ABGogw4xRLb0T_92WP_S7XWyqVhwBgGKWtuQwU4,5472
|
|
290
290
|
web/client/dist/assets/Audits-BuHAmFO8.js,sha256=zbYUF6WdUGMbnMm01GMNPb7xAJwj-o5wMdL56vPo2qE,1041
|
|
@@ -402,8 +402,8 @@ web/server/api/endpoints/models.py,sha256=kwj0s7uve3iZSMfmjkoPVMFMeY1sD0peTeyrWf
|
|
|
402
402
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
403
403
|
web/server/api/endpoints/plan.py,sha256=bbbY50W_2MsZSTxOHWMKz0tbIm75nsRSlPy8GI2fg9Q,9306
|
|
404
404
|
web/server/api/endpoints/table_diff.py,sha256=SCy3-pr5x6bEEiOaZGCDbiHQhpgxwmnz3Acqa2Ie6jI,2090
|
|
405
|
-
sqlmesh-0.200.1.
|
|
406
|
-
sqlmesh-0.200.1.
|
|
407
|
-
sqlmesh-0.200.1.
|
|
408
|
-
sqlmesh-0.200.1.
|
|
409
|
-
sqlmesh-0.200.1.
|
|
405
|
+
sqlmesh-0.200.1.dev22.dist-info/METADATA,sha256=Sew2eEXfajZ7R0CE1lLvlr1AQ68Za_m9Iw5HfXy9yw8,26679
|
|
406
|
+
sqlmesh-0.200.1.dev22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
407
|
+
sqlmesh-0.200.1.dev22.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
408
|
+
sqlmesh-0.200.1.dev22.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
409
|
+
sqlmesh-0.200.1.dev22.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|