sqlmesh 0.194.1.dev4__py3-none-any.whl → 0.194.1.dev6__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.194.1.dev4'
21
- __version_tuple__ = version_tuple = (0, 194, 1, 'dev4')
20
+ __version__ = version = '0.194.1.dev6'
21
+ __version_tuple__ = version_tuple = (0, 194, 1, 'dev6')
sqlmesh/core/console.py CHANGED
@@ -1957,26 +1957,29 @@ class TerminalConsole(Console):
1957
1957
  divider_length = 70
1958
1958
 
1959
1959
  self._log_test_details(result)
1960
- self._print("\n")
1961
1960
 
1961
+ message = (
1962
+ f"Ran {result.testsRun} tests against {target_dialect} in {result.duration} seconds."
1963
+ )
1962
1964
  if result.wasSuccessful():
1963
1965
  self._print("=" * divider_length)
1964
1966
  self._print(
1965
- f"Successfully Ran {str(result.testsRun)} tests against {target_dialect}",
1967
+ f"Successfully {message}",
1966
1968
  style="green",
1967
1969
  )
1968
1970
  self._print("-" * divider_length)
1969
1971
  else:
1970
1972
  self._print("-" * divider_length)
1971
- self._print("Test Failure Summary")
1973
+ self._print("Test Failure Summary", style="red")
1972
1974
  self._print("=" * divider_length)
1973
- self._print(
1974
- f"Num Successful Tests: {result.testsRun - len(result.failures) - len(result.errors)}"
1975
- )
1975
+ failures = len(result.failures) + len(result.errors)
1976
+ self._print(f"{message} \n")
1977
+
1978
+ self._print(f"Failed tests ({failures}):")
1976
1979
  for test, _ in result.failures + result.errors:
1977
1980
  if isinstance(test, ModelTest):
1978
- self._print(f"Failure Test: {test.path}::{test.test_name}")
1979
- self._print("=" * divider_length)
1981
+ self._print(f" • {test.path}::{test.test_name}")
1982
+ self._print("=" * divider_length, end="\n\n")
1980
1983
 
1981
1984
  def _captured_unit_test_results(self, result: ModelTextTestResult) -> str:
1982
1985
  with self.console.capture() as capture:
@@ -2499,7 +2502,9 @@ class TerminalConsole(Console):
2499
2502
  else:
2500
2503
  self.log_warning(msg)
2501
2504
 
2502
- def _log_test_details(self, result: ModelTextTestResult) -> None:
2505
+ def _log_test_details(
2506
+ self, result: ModelTextTestResult, unittest_char_separator: bool = True
2507
+ ) -> None:
2503
2508
  """
2504
2509
  This is a helper method that encapsulates the logic for logging the relevant unittest for the result.
2505
2510
  The top level method (`log_test_results`) reuses `_log_test_details` differently based on the console.
@@ -2507,11 +2512,14 @@ class TerminalConsole(Console):
2507
2512
  Args:
2508
2513
  result: The unittest test result that contains metrics like num success, fails, ect.
2509
2514
  """
2510
- tests_run = result.testsRun
2515
+
2516
+ if result.wasSuccessful():
2517
+ self._print("\n", end="")
2518
+ return
2519
+
2511
2520
  errors = result.errors
2512
2521
  failures = result.failures
2513
2522
  skipped = result.skipped
2514
- is_success = not (errors or failures)
2515
2523
 
2516
2524
  infos = []
2517
2525
  if failures:
@@ -2521,12 +2529,13 @@ class TerminalConsole(Console):
2521
2529
  if skipped:
2522
2530
  infos.append(f"skipped={skipped}")
2523
2531
 
2524
- self._print("\n", end="")
2532
+ if unittest_char_separator:
2533
+ self._print(f"\n{unittest.TextTestResult.separator1}\n\n", end="")
2525
2534
 
2526
2535
  for (test_case, failure), test_failure_tables in zip_longest( # type: ignore
2527
2536
  failures, result.failure_tables
2528
2537
  ):
2529
- self._print(unittest.TextTestResult.separator1)
2538
+ self._print(unittest.TextTestResult.separator2)
2530
2539
  self._print(f"FAIL: {test_case}")
2531
2540
 
2532
2541
  if test_description := test_case.shortDescription():
@@ -2541,21 +2550,11 @@ class TerminalConsole(Console):
2541
2550
  self._print("\n", end="")
2542
2551
 
2543
2552
  for test_case, error in errors:
2544
- self._print(unittest.TextTestResult.separator1)
2553
+ self._print(unittest.TextTestResult.separator2)
2545
2554
  self._print(f"ERROR: {test_case}")
2546
2555
  self._print(f"{unittest.TextTestResult.separator2}")
2547
2556
  self._print(error)
2548
2557
 
2549
- # Output final report
2550
- self._print(unittest.TextTestResult.separator2)
2551
- test_duration_msg = f" in {result.duration:.3f}s" if result.duration else ""
2552
- self._print(
2553
- f"\nRan {tests_run} {'tests' if tests_run > 1 else 'test'}{test_duration_msg} \n"
2554
- )
2555
- self._print(
2556
- f"{'OK' if is_success else 'FAILED'}{' (' + ', '.join(infos) + ')' if infos else ''}"
2557
- )
2558
-
2559
2558
 
2560
2559
  def _cells_match(x: t.Any, y: t.Any) -> bool:
2561
2560
  """Helper function to compare two cells and returns true if they're equal, handling array objects."""
@@ -2836,6 +2835,11 @@ class NotebookMagicConsole(TerminalConsole):
2836
2835
  "font-weight": "bold",
2837
2836
  "font-family": "Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace",
2838
2837
  }
2838
+
2839
+ message = (
2840
+ f"Ran {result.testsRun} tests against {target_dialect} in {result.duration} seconds."
2841
+ )
2842
+
2839
2843
  if result.wasSuccessful():
2840
2844
  success_color = {"color": "#008000"}
2841
2845
  header = str(h("span", {"style": shared_style}, "-" * divider_length))
@@ -2843,7 +2847,7 @@ class NotebookMagicConsole(TerminalConsole):
2843
2847
  h(
2844
2848
  "span",
2845
2849
  {"style": {**shared_style, **success_color}},
2846
- f"Successfully Ran {str(result.testsRun)} tests against {target_dialect}",
2850
+ f"Successfully {message}",
2847
2851
  )
2848
2852
  )
2849
2853
  footer = str(h("span", {"style": shared_style}, "=" * divider_length))
@@ -2855,31 +2859,31 @@ class NotebookMagicConsole(TerminalConsole):
2855
2859
  fail_shared_style = {**shared_style, **fail_color}
2856
2860
  header = str(h("span", {"style": fail_shared_style}, "-" * divider_length))
2857
2861
  message = str(h("span", {"style": fail_shared_style}, "Test Failure Summary"))
2858
- num_success = str(
2859
- h(
2860
- "span",
2861
- {"style": fail_shared_style},
2862
- f"Num Successful Tests: {result.testsRun - len(result.failures) - len(result.errors)}",
2862
+ failed_tests = [
2863
+ str(
2864
+ h(
2865
+ "span",
2866
+ {"style": fail_shared_style},
2867
+ f"Failed tests ({len(result.failures) + len(result.errors)}):",
2868
+ )
2863
2869
  )
2864
- )
2865
- failure_tests = []
2870
+ ]
2871
+
2866
2872
  for test, _ in result.failures + result.errors:
2867
2873
  if isinstance(test, ModelTest):
2868
- failure_tests.append(
2874
+ failed_tests.append(
2869
2875
  str(
2870
2876
  h(
2871
2877
  "span",
2872
2878
  {"style": fail_shared_style},
2873
- f"Failure Test: {test.model.name} {test.test_name}",
2879
+ f" • {test.model.name}::{test.test_name}",
2874
2880
  )
2875
2881
  )
2876
2882
  )
2877
- failures = "<br>".join(failure_tests)
2883
+ failures = "<br>".join(failed_tests)
2878
2884
  footer = str(h("span", {"style": fail_shared_style}, "=" * divider_length))
2879
2885
  error_output = widgets.Textarea(output, layout={"height": "300px", "width": "100%"})
2880
- test_info = widgets.HTML(
2881
- "<br>".join([header, message, footer, num_success, failures, footer])
2882
- )
2886
+ test_info = widgets.HTML("<br>".join([header, message, footer, failures, footer]))
2883
2887
  self.display(widgets.VBox(children=[test_info, error_output], layout={"width": "100%"}))
2884
2888
 
2885
2889
 
@@ -3202,21 +3206,21 @@ class MarkdownConsole(CaptureTerminalConsole):
3202
3206
  self._print(message)
3203
3207
 
3204
3208
  def log_test_results(self, result: ModelTextTestResult, target_dialect: str) -> None:
3209
+ message = f"Ran `{result.testsRun}` Tests Against `{target_dialect}`"
3210
+
3205
3211
  if result.wasSuccessful():
3206
- self._print(
3207
- f"**Successfully Ran `{str(result.testsRun)}` Tests Against `{target_dialect}`**\n\n"
3208
- )
3212
+ self._print(f"**Successfully {message}**\n\n")
3209
3213
  else:
3210
3214
  self._print("```")
3211
- self._log_test_details(result)
3215
+ self._log_test_details(result, unittest_char_separator=False)
3212
3216
  self._print("```\n\n")
3213
3217
 
3214
- self._print(
3215
- f"**Num Successful Tests: {result.testsRun - len(result.failures) - len(result.errors)}**\n\n"
3216
- )
3218
+ failures = len(result.failures) + len(result.errors)
3219
+ self._print(f"**{message}**\n")
3220
+ self._print(f"**Failed tests ({failures}):**")
3217
3221
  for test, _ in result.failures + result.errors:
3218
3222
  if isinstance(test, ModelTest):
3219
- self._print(f"* Failure Test: `{test.model.name}` - `{test.test_name}`\n\n")
3223
+ self._print(f" • `{test.model.name}`::`{test.test_name}`\n\n")
3220
3224
 
3221
3225
  def log_skipped_models(self, snapshot_names: t.Set[str]) -> None:
3222
3226
  if snapshot_names:
@@ -174,6 +174,6 @@ def run_tests(
174
174
 
175
175
  end_time = time.perf_counter()
176
176
 
177
- combined_results.duration = end_time - start_time
177
+ combined_results.duration = round(end_time - start_time, 2)
178
178
 
179
179
  return combined_results
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlmesh
3
- Version: 0.194.1.dev4
3
+ Version: 0.194.1.dev6
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=0ERckgNd-5NHMEFIqcJEPQ2bB4cOPNyc-DXx6QhBNKo,528
2
+ sqlmesh/_version.py,sha256=GaG5lGyF5UardkgS4_GICvhrgnCc3Ufl5IPN0hMNZe0,528
3
3
  sqlmesh/magics.py,sha256=ysPC5ohXpgQ8IHQPwtQtwGoVypmVq_YBlm1noUueDIw,40448
4
4
  sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -11,7 +11,7 @@ sqlmesh/cli/main.py,sha256=CM97CwI_DkrcE6TfJOwpiAaheYDr8WE7Tl-8asgV-Yw,33845
11
11
  sqlmesh/cli/options.py,sha256=aC_L5WnMScKzMU55BD1Y-8R-QzqCkPSYrlCI-payHRA,1333
12
12
  sqlmesh/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  sqlmesh/core/_typing.py,sha256=e1f7xO2aZCy38M_3VoDy-XI3shyd99-IFctgIFSgXWM,497
14
- sqlmesh/core/console.py,sha256=DO8Ixq6tR4H6EIhpZRvObMclt5qZN9_IMt7OKkWsOZA,153591
14
+ sqlmesh/core/console.py,sha256=pMIkBjaigneVqGkoGxOKVmT423RPfbDKX8TQ8D1SzpU,153466
15
15
  sqlmesh/core/constants.py,sha256=pnQXs5cS61zqjS8szbA1IRYTZ_G5jIt8Qrw-gneQoqE,2594
16
16
  sqlmesh/core/context.py,sha256=75OCaNpPTk8ZlzMWKdjX8kcPDaXcREmxzfrUyPOVfr0,118175
17
17
  sqlmesh/core/context_diff.py,sha256=TCzM8egBE35DskpouOB-GQM2Qf5iUHWbRgiB5yZ6tzg,21552
@@ -122,7 +122,7 @@ sqlmesh/core/test/context.py,sha256=Shmft5gRWCsk8Hropfmd4otWkLmw43r_uzrr6Azu5Ns,
122
122
  sqlmesh/core/test/definition.py,sha256=1V6EoaEpAWwiMpJIV630h-HcSTTQQuTZVhua7VWL4So,41301
123
123
  sqlmesh/core/test/discovery.py,sha256=WXIwPidLoacAGHoT_3TVFFEKamG89nHNtaMsZ01uGjs,1188
124
124
  sqlmesh/core/test/result.py,sha256=IIyR4uMDDFJ9Hf57iwrHgZ_W_tLwnr0KSWKeBJ0Pc6k,3961
125
- sqlmesh/core/test/runner.py,sha256=etwyGICHdPunx5-dUkC8oAA6khSQK5VpAztM4Yz9UgA,6159
125
+ sqlmesh/core/test/runner.py,sha256=8I-cL7Q9CggLvET_GPkrXB2YjlyCIHrvbFbbRDnSHRE,6169
126
126
  sqlmesh/dbt/__init__.py,sha256=KUv-lW5sG9D2ceXAIzA4MLcjyhzq3E-7qJP4P_PH2EU,144
127
127
  sqlmesh/dbt/adapter.py,sha256=pV8b8m_wqK3YJo_6D5b6cZBwgewFAPvAlvLO51UCBl4,16948
128
128
  sqlmesh/dbt/basemodel.py,sha256=XuiK9-r5JWzvZGEk98Jt4ukR2exfMDsotGZqYx5xluc,12561
@@ -282,7 +282,7 @@ sqlmesh/utils/pydantic.py,sha256=I898jAFqa3qU6lG2uPpRebVFncOUo8ZrLWM_R3K3DHU,116
282
282
  sqlmesh/utils/rich.py,sha256=BpB47G0-JcU41LkGkeGKroexj4NOV5fox4-GOIXPgIc,3545
283
283
  sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
284
284
  sqlmesh/utils/yaml.py,sha256=np-WVcwmwsKghCgAj1OBBMsK1SXSRn4wR-H37cGiFr8,2282
285
- sqlmesh-0.194.1.dev4.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
285
+ sqlmesh-0.194.1.dev6.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
286
286
  web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
287
287
  web/client/dist/index.html,sha256=w71qWSLmp-xwmVJO8m41k8Rtni3iZlF0hmhiTr-NeCI,5472
288
288
  web/client/dist/assets/Audits-sYYNn2gO.js,sha256=zSAKkif2kU0JuPH05xjNYITNPmsbDlvLKUc2-orr8AY,1041
@@ -400,8 +400,8 @@ web/server/api/endpoints/models.py,sha256=ud-lRwriyI_OYg9tZchrBgeiXELiRTLNEodraf
400
400
  web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
401
401
  web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
402
402
  web/server/api/endpoints/table_diff.py,sha256=SCy3-pr5x6bEEiOaZGCDbiHQhpgxwmnz3Acqa2Ie6jI,2090
403
- sqlmesh-0.194.1.dev4.dist-info/METADATA,sha256=QY1EqkFoRee2cK9yBd76qwQYZVRNmw0jiYghl9hqwIE,26690
404
- sqlmesh-0.194.1.dev4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
405
- sqlmesh-0.194.1.dev4.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
406
- sqlmesh-0.194.1.dev4.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
407
- sqlmesh-0.194.1.dev4.dist-info/RECORD,,
403
+ sqlmesh-0.194.1.dev6.dist-info/METADATA,sha256=2TdZyYnHb3P4M3K_qFi2i2zkiLEnv0axxJRVo76JbPI,26690
404
+ sqlmesh-0.194.1.dev6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
405
+ sqlmesh-0.194.1.dev6.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
406
+ sqlmesh-0.194.1.dev6.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
407
+ sqlmesh-0.194.1.dev6.dist-info/RECORD,,