sqlmesh 0.188.2.dev26__py3-none-any.whl → 0.188.2.dev27__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/console.py +1 -1
- sqlmesh/core/engine_adapter/mssql.py +1 -1
- sqlmesh/core/model/definition.py +2 -1
- sqlmesh/core/test/definition.py +6 -1
- {sqlmesh-0.188.2.dev26.dist-info → sqlmesh-0.188.2.dev27.dist-info}/METADATA +1 -1
- {sqlmesh-0.188.2.dev26.dist-info → sqlmesh-0.188.2.dev27.dist-info}/RECORD +12 -12
- web/server/api/endpoints/table_diff.py +2 -1
- {sqlmesh-0.188.2.dev26.dist-info → sqlmesh-0.188.2.dev27.dist-info}/WHEEL +0 -0
- {sqlmesh-0.188.2.dev26.dist-info → sqlmesh-0.188.2.dev27.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.188.2.dev26.dist-info → sqlmesh-0.188.2.dev27.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.188.2.dev26.dist-info → sqlmesh-0.188.2.dev27.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.188.2.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 188, 2, '
|
|
20
|
+
__version__ = version = '0.188.2.dev27'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 188, 2, 'dev27')
|
sqlmesh/core/console.py
CHANGED
|
@@ -8,7 +8,6 @@ import uuid
|
|
|
8
8
|
import logging
|
|
9
9
|
import textwrap
|
|
10
10
|
from pathlib import Path
|
|
11
|
-
import numpy as np
|
|
12
11
|
from hyperscript import h
|
|
13
12
|
from rich.console import Console as RichConsole
|
|
14
13
|
from rich.live import Live
|
|
@@ -2497,6 +2496,7 @@ class TerminalConsole(Console):
|
|
|
2497
2496
|
def _cells_match(x: t.Any, y: t.Any) -> bool:
|
|
2498
2497
|
"""Helper function to compare two cells and returns true if they're equal, handling array objects."""
|
|
2499
2498
|
import pandas as pd
|
|
2499
|
+
import numpy as np
|
|
2500
2500
|
|
|
2501
2501
|
# Convert array-like objects to list for consistent comparison
|
|
2502
2502
|
def _normalize(val: t.Any) -> t.Any:
|
|
@@ -4,7 +4,6 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import typing as t
|
|
6
6
|
|
|
7
|
-
import numpy as np
|
|
8
7
|
from sqlglot import exp
|
|
9
8
|
|
|
10
9
|
from sqlmesh.core.dialect import to_schema
|
|
@@ -215,6 +214,7 @@ class MSSQLEngineAdapter(
|
|
|
215
214
|
target_table: TableName,
|
|
216
215
|
) -> t.List[SourceQuery]:
|
|
217
216
|
import pandas as pd
|
|
217
|
+
import numpy as np
|
|
218
218
|
|
|
219
219
|
assert isinstance(df, pd.DataFrame)
|
|
220
220
|
temp_table = self._get_temp_table(target_table or "pandas")
|
sqlmesh/core/model/definition.py
CHANGED
|
@@ -8,7 +8,6 @@ import typing as t
|
|
|
8
8
|
from functools import cached_property, partial
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
|
|
11
|
-
import numpy as np
|
|
12
11
|
from pydantic import Field
|
|
13
12
|
from sqlglot import diff, exp
|
|
14
13
|
from sqlglot.diff import Insert
|
|
@@ -1565,6 +1564,8 @@ class SeedModel(_Model):
|
|
|
1565
1564
|
yield from self.render_seed()
|
|
1566
1565
|
|
|
1567
1566
|
def render_seed(self) -> t.Iterator[QueryOrDF]:
|
|
1567
|
+
import numpy as np
|
|
1568
|
+
|
|
1568
1569
|
self._ensure_hydrated()
|
|
1569
1570
|
|
|
1570
1571
|
date_columns = []
|
sqlmesh/core/test/definition.py
CHANGED
|
@@ -10,7 +10,6 @@ from itertools import chain
|
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
from unittest.mock import patch
|
|
12
12
|
|
|
13
|
-
import numpy as np
|
|
14
13
|
from io import StringIO
|
|
15
14
|
from sqlglot import Dialect, exp
|
|
16
15
|
from sqlglot.optimizer.annotate_types import annotate_types
|
|
@@ -207,6 +206,7 @@ class ModelTest(unittest.TestCase):
|
|
|
207
206
|
partial: t.Optional[bool] = False,
|
|
208
207
|
) -> None:
|
|
209
208
|
"""Compare two DataFrames"""
|
|
209
|
+
import numpy as np
|
|
210
210
|
import pandas as pd
|
|
211
211
|
from pandas.api.types import is_object_dtype
|
|
212
212
|
|
|
@@ -775,6 +775,8 @@ def generate_test(
|
|
|
775
775
|
name: The name of the test. This is inferred from the model name by default.
|
|
776
776
|
include_ctes: When true, CTE fixtures will also be generated.
|
|
777
777
|
"""
|
|
778
|
+
import numpy as np
|
|
779
|
+
|
|
778
780
|
test_name = name or f"test_{model.view_name}"
|
|
779
781
|
path = path or f"{test_name}.yaml"
|
|
780
782
|
|
|
@@ -902,6 +904,7 @@ def _raise_if_unexpected_columns(
|
|
|
902
904
|
|
|
903
905
|
def _row_difference(left: pd.DataFrame, right: pd.DataFrame) -> pd.DataFrame:
|
|
904
906
|
"""Returns all rows in `left` that don't appear in `right`."""
|
|
907
|
+
import numpy as np
|
|
905
908
|
import pandas as pd
|
|
906
909
|
|
|
907
910
|
rows_missing_from_right = []
|
|
@@ -928,6 +931,8 @@ def _raise_error(msg: str, path: Path | None = None) -> None:
|
|
|
928
931
|
|
|
929
932
|
def _normalize_df_value(value: t.Any) -> t.Any:
|
|
930
933
|
"""Normalize data in a pandas dataframe so ruamel and sqlglot can deal with it."""
|
|
934
|
+
import numpy as np
|
|
935
|
+
|
|
931
936
|
if isinstance(value, (list, np.ndarray)):
|
|
932
937
|
return [_normalize_df_value(v) for v in value]
|
|
933
938
|
if isinstance(value, dict):
|
|
@@ -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=eBq-pYIhg7b2433yFQEu9enWW25YbMsQpBCKEI-oL9w,530
|
|
3
3
|
sqlmesh/magics.py,sha256=fu7-OeT_0_TAkWZOLoiioE3-3iFpvTRxFCbQUlRnfuw,39944
|
|
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=dt92CJPuMzUZvBYqXMh-tkUCaLfj2Z5RC2COa98_9Co,32310
|
|
|
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=
|
|
14
|
+
sqlmesh/core/console.py,sha256=x7qWETjHgu8ZpMtfW8V3bGKByT4nZXDjgtO6xmvAb-I,151143
|
|
15
15
|
sqlmesh/core/constants.py,sha256=oqt6zjepUhQoWlgapKn_HpG7Pu9mrFwepdX5caNfJUI,2499
|
|
16
16
|
sqlmesh/core/context.py,sha256=GyBO6rU_k0CAMsD1J6FdqwFDctTeDIVl-ZP6Z2zF_5U,116429
|
|
17
17
|
sqlmesh/core/context_diff.py,sha256=I7luvY2za30E5ynVaFPaEQQEmNViJpWAmW48PGSyDCU,21135
|
|
@@ -66,7 +66,7 @@ sqlmesh/core/engine_adapter/clickhouse.py,sha256=LoPdm_s_s-ZxS1XJPA3Et0iOHeJ1Lgq
|
|
|
66
66
|
sqlmesh/core/engine_adapter/databricks.py,sha256=8ZExPIeT3dDh9MTJW8udvmh9LiY-f9HkRAN1Q5Qebhs,14541
|
|
67
67
|
sqlmesh/core/engine_adapter/duckdb.py,sha256=FfNmBzLySDDi--nTlsSavTwdperCzhpYzDoroCilPcA,4900
|
|
68
68
|
sqlmesh/core/engine_adapter/mixins.py,sha256=HMB0Z9O3p5jaTZMolKiWKqpVDZokf5GoI99YXwEJ8bc,22470
|
|
69
|
-
sqlmesh/core/engine_adapter/mssql.py,sha256=
|
|
69
|
+
sqlmesh/core/engine_adapter/mssql.py,sha256=nsBM9U6N6CmKCY8gr8PTNeQAMD8UeSM51uM9eCjlP3A,13880
|
|
70
70
|
sqlmesh/core/engine_adapter/mysql.py,sha256=lVC-siXZK3iSfqCmBjZNw8uy09Z8la8v8_oUZ-E2OwI,6966
|
|
71
71
|
sqlmesh/core/engine_adapter/postgres.py,sha256=fdQrsBodfGlNf8lZYkS99U_gjoDyaYKEVKLgScduv3I,4601
|
|
72
72
|
sqlmesh/core/engine_adapter/redshift.py,sha256=B4GsPggz-xyvBpx5qubvVwEeKF3vk7n5SMExL-Q5Ysw,16754
|
|
@@ -87,7 +87,7 @@ sqlmesh/core/model/__init__.py,sha256=C8GRZ53xuXEA9hQv3BQS9pNNyd9rZ06R_B96UYGhDu
|
|
|
87
87
|
sqlmesh/core/model/cache.py,sha256=csun0RJguHzKX6-qITcOs4fVP4f8_Ts8qiUVV4sHY6Q,7869
|
|
88
88
|
sqlmesh/core/model/common.py,sha256=vbcXFhWE22-FeKYAVIlKWvTb-wkeC8XISjU_TIlak0c,16252
|
|
89
89
|
sqlmesh/core/model/decorator.py,sha256=v_sVudNROGrtj5cZ3vgcOFnwPdzwoUGY6REAkQpIMQc,8927
|
|
90
|
-
sqlmesh/core/model/definition.py,sha256=
|
|
90
|
+
sqlmesh/core/model/definition.py,sha256=G2FHqCsJaDOzRcJCdTlfe6Ygl55rh9RAEXC1Zaka8uA,108470
|
|
91
91
|
sqlmesh/core/model/kind.py,sha256=i6_AMBarXPGPoMdF9kzBkyqS9tu__a2339-BoX7TgCM,36010
|
|
92
92
|
sqlmesh/core/model/meta.py,sha256=TRsCztBea2gSknPQxoY1ct13hdWgD0mM9XTHqu5KDgs,21167
|
|
93
93
|
sqlmesh/core/model/schema.py,sha256=OClbAeA8LpW-IiSiLT_TlDWkEqmIIvSk0GXq8SWI-GQ,3443
|
|
@@ -116,7 +116,7 @@ sqlmesh/core/state_sync/db/utils.py,sha256=204OpT3ISFPCwWP9Aqq8nr6ETl24sbG5uOyo8
|
|
|
116
116
|
sqlmesh/core/state_sync/db/version.py,sha256=fl5g1tNMYu8O6WTN4J3bciwjGq0c5nZlRDlxxRKGU78,2210
|
|
117
117
|
sqlmesh/core/test/__init__.py,sha256=e83TJPwPRR_rAG29Y0OVbZb-5oWVBzz-_wrcd22Qk10,418
|
|
118
118
|
sqlmesh/core/test/context.py,sha256=Shmft5gRWCsk8Hropfmd4otWkLmw43r_uzrr6Azu5Ns,2220
|
|
119
|
-
sqlmesh/core/test/definition.py,sha256=
|
|
119
|
+
sqlmesh/core/test/definition.py,sha256=YUld-sKPDy-2TTNjR-U4gGs_49rSP-h9dyu7RHQ0EK0,37442
|
|
120
120
|
sqlmesh/core/test/discovery.py,sha256=WXIwPidLoacAGHoT_3TVFFEKamG89nHNtaMsZ01uGjs,1188
|
|
121
121
|
sqlmesh/core/test/result.py,sha256=CR8c_tdBK7p8jx-dMibbj4zCtxVAmE_Xah9GQ5oPBTE,4218
|
|
122
122
|
sqlmesh/core/test/runner.py,sha256=yno0GDUW9angCy2ZeLIZE9lKrqBiJOnFibu6RLuct6I,6647
|
|
@@ -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.188.2.
|
|
273
|
+
sqlmesh-0.188.2.dev27.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=LbR9XrOXE77otBPoDnaomssYz6h2TBwLANs6hUJ0p2M,5472
|
|
276
276
|
web/client/dist/assets/Audits-DB1HcP9M.js,sha256=eGI_Soj69Jntsixw1NqQpdwG94N5jipQZv7T1Y7WUSs,1041
|
|
@@ -387,9 +387,9 @@ web/server/api/endpoints/meta.py,sha256=QKWWrHewGh5JS8mCSWXTKCIQwXw-TQfaT9tWt_Ss
|
|
|
387
387
|
web/server/api/endpoints/models.py,sha256=ud-lRwriyI_OYg9tZchrBgeiXELiRTLNEodrafB7Ndk,4697
|
|
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
|
-
web/server/api/endpoints/table_diff.py,sha256=
|
|
391
|
-
sqlmesh-0.188.2.
|
|
392
|
-
sqlmesh-0.188.2.
|
|
393
|
-
sqlmesh-0.188.2.
|
|
394
|
-
sqlmesh-0.188.2.
|
|
395
|
-
sqlmesh-0.188.2.
|
|
390
|
+
web/server/api/endpoints/table_diff.py,sha256=SCy3-pr5x6bEEiOaZGCDbiHQhpgxwmnz3Acqa2Ie6jI,2090
|
|
391
|
+
sqlmesh-0.188.2.dev27.dist-info/METADATA,sha256=B17ZgzYNSYAvxsmIADdW6FA1n7lHLQfy-yWOIZacszc,26532
|
|
392
|
+
sqlmesh-0.188.2.dev27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
393
|
+
sqlmesh-0.188.2.dev27.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
394
|
+
sqlmesh-0.188.2.dev27.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
395
|
+
sqlmesh-0.188.2.dev27.dist-info/RECORD,,
|
|
@@ -2,7 +2,6 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import typing as t
|
|
4
4
|
|
|
5
|
-
import numpy as np
|
|
6
5
|
from fastapi import APIRouter, Depends
|
|
7
6
|
from sqlglot import exp
|
|
8
7
|
|
|
@@ -25,6 +24,8 @@ def get_table_diff(
|
|
|
25
24
|
context: Context = Depends(get_loaded_context),
|
|
26
25
|
) -> t.Optional[TableDiff]:
|
|
27
26
|
"""Calculate differences between tables, taking into account schema and row level differences."""
|
|
27
|
+
import numpy as np
|
|
28
|
+
|
|
28
29
|
table_diffs = context.table_diff(
|
|
29
30
|
source=source,
|
|
30
31
|
target=target,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|