sqlmesh 0.196.1.dev1__py3-none-any.whl → 0.196.1.dev3__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.196.1.dev1'
21
- __version_tuple__ = version_tuple = (0, 196, 1, 'dev1')
20
+ __version__ = version = '0.196.1.dev3'
21
+ __version_tuple__ = version_tuple = (0, 196, 1, 'dev3')
@@ -116,7 +116,7 @@ def _update_pr_environment(controller: GithubController) -> bool:
116
116
  return conclusion is not None and conclusion.is_success
117
117
  except Exception as e:
118
118
  conclusion = controller.update_pr_environment_check(
119
- status=GithubCheckStatus.COMPLETED, exception=e
119
+ status=GithubCheckStatus.COMPLETED, exception=e, plan=controller.pr_plan_or_none
120
120
  )
121
121
  return (
122
122
  conclusion is not None
@@ -276,7 +276,9 @@ def _run_all(controller: GithubController) -> None:
276
276
  if has_required_approval and prod_plan_generated and controller.pr_targets_prod_branch:
277
277
  deployed_to_prod = _deploy_production(controller)
278
278
  elif is_auto_deploying_prod:
279
- if not has_required_approval:
279
+ if controller.deploy_command_enabled and not has_required_approval:
280
+ skip_reason = "Skipped Deploying to Production because a `/deploy` command has not been detected yet"
281
+ elif controller.do_required_approval_check and not has_required_approval:
280
282
  skip_reason = (
281
283
  "Skipped Deploying to Production because a required approver has not approved"
282
284
  )
@@ -408,6 +408,13 @@ class GithubController:
408
408
  assert self._pr_plan_builder
409
409
  return self._pr_plan_builder.build()
410
410
 
411
+ @property
412
+ def pr_plan_or_none(self) -> t.Optional[Plan]:
413
+ try:
414
+ return self.pr_plan
415
+ except:
416
+ return None
417
+
411
418
  @property
412
419
  def prod_plan(self) -> Plan:
413
420
  if not self._prod_plan_builder:
@@ -823,6 +830,7 @@ class GithubController:
823
830
  self,
824
831
  status: GithubCheckStatus,
825
832
  exception: t.Optional[Exception] = None,
833
+ plan: t.Optional[Plan] = None,
826
834
  ) -> t.Optional[GithubCheckConclusion]:
827
835
  """
828
836
  Updates the status of the merge commit for the PR environment.
@@ -926,6 +934,14 @@ class GithubController:
926
934
  if captured_errors:
927
935
  logger.debug(f"Captured errors: {captured_errors}")
928
936
  failure_msg = f"**Errors:**\n{captured_errors}\n"
937
+ elif isinstance(exception, UncategorizedPlanError) and plan:
938
+ failure_msg = f"The following models could not be categorized automatically:\n"
939
+ for snapshot in plan.uncategorized:
940
+ failure_msg += f"- {snapshot.name}\n"
941
+ failure_msg += (
942
+ f"\nRun `sqlmesh plan {self.pr_environment_name}` locally to apply these changes.\n\n"
943
+ "If you would like the bot to automatically categorize changes, check the [documentation](https://sqlmesh.readthedocs.io/en/stable/integrations/github/) for more information."
944
+ )
929
945
  elif isinstance(exception, PlanError):
930
946
  failure_msg = f"Plan application failed.\n\n{self._console.captured_output}"
931
947
  elif isinstance(exception, (SQLMeshError, SqlglotError, ValueError)):
@@ -940,11 +956,12 @@ class GithubController:
940
956
  + traceback.format_exc()
941
957
  )
942
958
  failure_msg = f"This is an unexpected error.\n\n**Exception:**\n```\n{traceback.format_exc()}\n```"
959
+
943
960
  conclusion_to_summary = {
944
961
  GithubCheckConclusion.SKIPPED: f":next_track_button: Skipped creating or updating PR Environment `{self.pr_environment_name}`. {skip_reason}",
945
962
  GithubCheckConclusion.FAILURE: f":x: Failed to create or update PR Environment `{self.pr_environment_name}`.\n\n{failure_msg}",
946
963
  GithubCheckConclusion.CANCELLED: f":stop_sign: Cancelled creating or updating PR Environment `{self.pr_environment_name}`",
947
- GithubCheckConclusion.ACTION_REQUIRED: f":warning: Action Required to create or update PR Environment `{self.pr_environment_name}`. There are likely uncateogrized changes. Run `plan` locally to apply these changes. If you want the bot to automatically categorize changes, then check documentation (https://sqlmesh.readthedocs.io/en/stable/integrations/github/) for more information.",
964
+ GithubCheckConclusion.ACTION_REQUIRED: f":warning: Action Required to create or update PR Environment `{self.pr_environment_name}` :warning:\n\n{failure_msg}",
948
965
  }
949
966
  summary = conclusion_to_summary.get(
950
967
  conclusion, f":interrobang: Got an unexpected conclusion: {conclusion.value}"
@@ -1022,7 +1039,7 @@ class GithubController:
1022
1039
  conclusion_to_title = {
1023
1040
  GithubCheckConclusion.SUCCESS: "Deployed to Prod",
1024
1041
  GithubCheckConclusion.CANCELLED: "Cancelled deploying to prod",
1025
- GithubCheckConclusion.SKIPPED: skip_reason,
1042
+ GithubCheckConclusion.SKIPPED: "Skipped deployment",
1026
1043
  GithubCheckConclusion.FAILURE: "Failed to deploy to prod",
1027
1044
  GithubCheckConclusion.ACTION_REQUIRED: "Failed due to error applying plan",
1028
1045
  }
@@ -1031,7 +1048,7 @@ class GithubController:
1031
1048
  or f"Got an unexpected conclusion: {conclusion.value}"
1032
1049
  )
1033
1050
  if conclusion.is_skipped:
1034
- summary = title
1051
+ summary = skip_reason
1035
1052
  elif conclusion.is_failure:
1036
1053
  captured_errors = self._console.consume_captured_errors()
1037
1054
  summary = (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlmesh
3
- Version: 0.196.1.dev1
3
+ Version: 0.196.1.dev3
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=bOiNR580UTdckB4B91ib4JGk6jbToUVNlhSptdOa6hM,528
2
+ sqlmesh/_version.py,sha256=dN5zK22Lq_GrIZVnpH4TMmteuAITg9Avl2OLP1m4t98,528
3
3
  sqlmesh/magics.py,sha256=nMfwSW5rIkdnyO9MXYm9u24hNl6dqgAWybC-MnRcNnE,41451
4
4
  sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -162,9 +162,9 @@ sqlmesh/integrations/llm.py,sha256=URgp3JKr06HYv6hGlJ7DQ9m3QCc41xRWK23HzmGpbDI,1
162
162
  sqlmesh/integrations/slack.py,sha256=nxLxu5WztGbZH3JdqnzyPqmJUMfRdJ_49LQ7zR-u39Q,6801
163
163
  sqlmesh/integrations/github/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
164
164
  sqlmesh/integrations/github/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
165
- sqlmesh/integrations/github/cicd/command.py,sha256=bQCLLzWS3pZQpATWADPQE_TpDZTHOt0qYwxcNm3St0Q,11557
165
+ sqlmesh/integrations/github/cicd/command.py,sha256=hCY8SAiF-AOduOVKq01V7JxKoz57BnvByb4POgZfx7Q,11824
166
166
  sqlmesh/integrations/github/cicd/config.py,sha256=tRhMZaLf1p6AWXvi67n85Q-lptJNGt1Wk_Jr61ytpiM,2104
167
- sqlmesh/integrations/github/cicd/controller.py,sha256=CvyAjyOTSt9H8ojDLfz_4GDdpHe1hK4DUT7RL_yiybc,43790
167
+ sqlmesh/integrations/github/cicd/controller.py,sha256=QCs51Ag52Eu-2C5B2ivJ3Jgh7yThKj0eBqILGCHqizk,44436
168
168
  sqlmesh/lsp/api.py,sha256=_lA_buSPZFIoLJuINbS53LbNOOaHp3orb0uFTE3aCqI,2328
169
169
  sqlmesh/lsp/completions.py,sha256=Nt1XpFL_-QAIRM8BBBC6Ia6YG0hMZriiNJra7nGfD4Q,6676
170
170
  sqlmesh/lsp/context.py,sha256=QGbNL0sifxzVJ7T1U5oWcJ5FXrOrLrVKt1jtH1qM_50,6099
@@ -283,7 +283,7 @@ sqlmesh/utils/pydantic.py,sha256=I898jAFqa3qU6lG2uPpRebVFncOUo8ZrLWM_R3K3DHU,116
283
283
  sqlmesh/utils/rich.py,sha256=BpB47G0-JcU41LkGkeGKroexj4NOV5fox4-GOIXPgIc,3545
284
284
  sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
285
285
  sqlmesh/utils/yaml.py,sha256=hvo5lmybYLcIx4p6CQwufS8X4MbwS60lEBnCmYJCXmU,2336
286
- sqlmesh-0.196.1.dev1.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
286
+ sqlmesh-0.196.1.dev3.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
287
287
  web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
288
288
  web/client/dist/index.html,sha256=drXwzSCEVDTMfaIwzJYjnT8Xk4c-Y4wNJz-CflUa_vY,5472
289
289
  web/client/dist/assets/Audits-DrNQaTQA.js,sha256=E8JF632bsRUm6LGtgXlyHrJOYQe5VW2CgRZPaZNKvgg,1041
@@ -401,8 +401,8 @@ web/server/api/endpoints/models.py,sha256=ud-lRwriyI_OYg9tZchrBgeiXELiRTLNEodraf
401
401
  web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
402
402
  web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
403
403
  web/server/api/endpoints/table_diff.py,sha256=SCy3-pr5x6bEEiOaZGCDbiHQhpgxwmnz3Acqa2Ie6jI,2090
404
- sqlmesh-0.196.1.dev1.dist-info/METADATA,sha256=bOmoOZPhrFyNIqtsRTnIyrMJR38Jf-mc5Ioq2Uad-AM,26690
405
- sqlmesh-0.196.1.dev1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
406
- sqlmesh-0.196.1.dev1.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
407
- sqlmesh-0.196.1.dev1.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
408
- sqlmesh-0.196.1.dev1.dist-info/RECORD,,
404
+ sqlmesh-0.196.1.dev3.dist-info/METADATA,sha256=Y6vb00OQ0New0-z7vEa65vxUggEucF_gli8I4Xof5WY,26690
405
+ sqlmesh-0.196.1.dev3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
406
+ sqlmesh-0.196.1.dev3.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
407
+ sqlmesh-0.196.1.dev3.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
408
+ sqlmesh-0.196.1.dev3.dist-info/RECORD,,