sqlmesh 0.196.1.dev2__py3-none-any.whl → 0.196.1.dev4__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.dev2'
21
- __version_tuple__ = version_tuple = (0, 196, 1, 'dev2')
20
+ __version__ = version = '0.196.1.dev4'
21
+ __version_tuple__ = version_tuple = (0, 196, 1, 'dev4')
@@ -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
@@ -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}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlmesh
3
- Version: 0.196.1.dev2
3
+ Version: 0.196.1.dev4
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=T3TOuwwG7lDoyDPW-ns25kpuEBPYyBK1G1qdP7WuvZk,528
2
+ sqlmesh/_version.py,sha256=7t8C0kEKJWqTH-kL0UAU1xOCz2miDlgoxSBKJ0QCvMA,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=ZhHxnYzXICvnfOgBk2NzpqhsM2cyVxgs-SGpH36IUs4,11791
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=F0Dh2NDTj8ZBUhUGGYNpC-ZjY-xoMY944yUUzEgLsk4,43805
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.dev2.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
286
+ sqlmesh-0.196.1.dev4.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.dev2.dist-info/METADATA,sha256=_VppuqJpefmk1SENSpk8TaVD9BnjcQPHO3fDs7a-o7Y,26690
405
- sqlmesh-0.196.1.dev2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
406
- sqlmesh-0.196.1.dev2.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
407
- sqlmesh-0.196.1.dev2.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
408
- sqlmesh-0.196.1.dev2.dist-info/RECORD,,
404
+ sqlmesh-0.196.1.dev4.dist-info/METADATA,sha256=uv6fZGChbG2btFPPUf4yrluOqmTMDoLNEHUdyEYEszs,26690
405
+ sqlmesh-0.196.1.dev4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
406
+ sqlmesh-0.196.1.dev4.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
407
+ sqlmesh-0.196.1.dev4.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
408
+ sqlmesh-0.196.1.dev4.dist-info/RECORD,,