sqlmesh 0.225.1.dev7__py3-none-any.whl → 0.225.1.dev8__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
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.225.1.dev7'
32
- __version_tuple__ = version_tuple = (0, 225, 1, 'dev7')
31
+ __version__ = version = '0.225.1.dev8'
32
+ __version_tuple__ = version_tuple = (0, 225, 1, 'dev8')
33
33
 
34
34
  __commit_id__ = commit_id = None
sqlmesh/core/context.py CHANGED
@@ -139,6 +139,7 @@ from sqlmesh.utils.errors import (
139
139
  )
140
140
  from sqlmesh.utils.config import print_config
141
141
  from sqlmesh.utils.jinja import JinjaMacroRegistry
142
+ from sqlmesh.utils.windows import IS_WINDOWS, fix_windows_path
142
143
 
143
144
  if t.TYPE_CHECKING:
144
145
  import pandas as pd
@@ -2590,12 +2591,15 @@ class GenericContext(BaseContext, t.Generic[C]):
2590
2591
  )
2591
2592
 
2592
2593
  def clear_caches(self) -> None:
2593
- for path in self.configs:
2594
- cache_path = path / c.CACHE
2595
- if cache_path.exists():
2596
- rmtree(cache_path)
2597
- if self.cache_dir.exists():
2598
- rmtree(self.cache_dir)
2594
+ paths_to_remove = [path / c.CACHE for path in self.configs]
2595
+ paths_to_remove.append(self.cache_dir)
2596
+
2597
+ if IS_WINDOWS:
2598
+ paths_to_remove = [fix_windows_path(path) for path in paths_to_remove]
2599
+
2600
+ for path in paths_to_remove:
2601
+ if path.exists():
2602
+ rmtree(path)
2599
2603
 
2600
2604
  if isinstance(self._state_sync, CachingStateSync):
2601
2605
  self._state_sync.clear_cache()
sqlmesh/utils/windows.py CHANGED
@@ -3,12 +3,22 @@ from pathlib import Path
3
3
 
4
4
  IS_WINDOWS = platform.system() == "Windows"
5
5
 
6
+ WINDOWS_LONGPATH_PREFIX = "\\\\?\\"
7
+
6
8
 
7
9
  def fix_windows_path(path: Path) -> Path:
8
10
  """
9
11
  Windows paths are limited to 260 characters: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
10
12
  Users can change this by updating a registry entry but we cant rely on that.
11
- We can quite commonly generate a cache file path that exceeds 260 characters which causes a FileNotFound error.
12
- If we prefix the path with "\\?\" then we can have paths up to 32,767 characters
13
+
14
+ SQLMesh quite commonly generates cache file paths that exceed 260 characters and thus cause a FileNotFound error.
15
+ If we prefix paths with "\\?\" then we can have paths up to 32,767 characters.
16
+
17
+ Note that this prefix also means that relative paths no longer work. From the above docs:
18
+ > Because you cannot use the "\\?\" prefix with a relative path, relative paths are always limited to a total of MAX_PATH characters.
19
+
20
+ So we also call path.resolve() to resolve the relative sections so that operations like `path.read_text()` continue to work
13
21
  """
14
- return Path("\\\\?\\" + str(path.absolute()))
22
+ if path.parts and not path.parts[0].startswith(WINDOWS_LONGPATH_PREFIX):
23
+ path = Path(WINDOWS_LONGPATH_PREFIX + str(path.absolute()))
24
+ return path.resolve()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlmesh
3
- Version: 0.225.1.dev7
3
+ Version: 0.225.1.dev8
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=v_spqQEhcnGaahp1yPvMqUIa6mhH3cs3Bc1CznxvCEA,7965
2
- sqlmesh/_version.py,sha256=P8RwDzQuZc-DG-175QObyttNeICQmKzKpJ5t66c2Whk,721
2
+ sqlmesh/_version.py,sha256=rV17A_kMcZz30psoLrPixPeM_oQ4cYwJfBa98nn_kwY,721
3
3
  sqlmesh/magics.py,sha256=xLh3u4eqpVrKRVN5KF3X84RPRqjygAB9AJP1TXwH8hg,42086
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=PzXxMYnORq18JhblAOUttms3zPJZzZpIbfFA_jgKYPA,498
14
14
  sqlmesh/core/console.py,sha256=MYpVlciUY6rUuoqXyKfXTxD6a4-Bw4-ooATUTj_VHGg,172830
15
15
  sqlmesh/core/constants.py,sha256=BuQk43vluUm7LfP9nKp5o9qRhqIenWF_LiLXO_t_53c,2699
16
- sqlmesh/core/context.py,sha256=AU9pj6TX38ghuEkR3AdS7DKHbyNg_8LPXw5h_N1HAWU,130775
16
+ sqlmesh/core/context.py,sha256=dgtgIabNtdhVPsQ-tUY5lwK-SnCQxqDdRNY6f3TVMgY,130941
17
17
  sqlmesh/core/context_diff.py,sha256=mxkJu0IthFMOlaQ_kcq5C09mlgkq2RQb-pG2rd-x_nA,21648
18
18
  sqlmesh/core/dialect.py,sha256=CnKcPj6BnREfu9Zn1OyS7hZ3ktnaX03ygOg91nADlTU,53029
19
19
  sqlmesh/core/environment.py,sha256=Kgs_gUEUI072mh0JJFWNRynrCxp1TzRHZhX_NWJRfXc,13142
@@ -236,9 +236,9 @@ sqlmesh/utils/pandas.py,sha256=FytTSLcRNtO0-YMvpoDBkkut3yoQJR9mBSKpif8lxug,2497
236
236
  sqlmesh/utils/process.py,sha256=vpXcpJ1eIbivs7gZdwTKSJI7OS6kKBebnaBzz75ykvs,2428
237
237
  sqlmesh/utils/pydantic.py,sha256=o_NsXbIpDqNpUA1Uc5xF0ZzoXQYYB0DfHwdRxBwXPNk,12089
238
238
  sqlmesh/utils/rich.py,sha256=cwQ5nJ6sgz64xHtoh6_ec7ReV5YpsOGhMtUJnwoRfEI,3549
239
- sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
239
+ sqlmesh/utils/windows.py,sha256=0F9RdpuuCoG5NiEDXvWlAGCiJ-59OjSAmgFF5wW05aY,1133
240
240
  sqlmesh/utils/yaml.py,sha256=KFBd7hsKNRTtRudGR7d410qUYffQv0EWRcDM8hVNNZg,3025
241
- sqlmesh-0.225.1.dev7.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
241
+ sqlmesh-0.225.1.dev8.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
242
242
  sqlmesh_dbt/__init__.py,sha256=awYS5y5mz-1NUmx6i5h5NSTJ7tidRl9NC0FAnFWSF6U,350
243
243
  sqlmesh_dbt/cli.py,sha256=eAeOZtHOikSDEZNI6hnZYJ-pja6ijFldRV4PeSzwYwU,5744
244
244
  sqlmesh_dbt/console.py,sha256=RwWLYnEZHzn9Xp-e2gbZvkdKbWbBLN146geI84mJitg,1132
@@ -363,8 +363,8 @@ web/server/api/endpoints/models.py,sha256=kwj0s7uve3iZSMfmjkoPVMFMeY1sD0peTeyrWf
363
363
  web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
364
364
  web/server/api/endpoints/plan.py,sha256=bbbY50W_2MsZSTxOHWMKz0tbIm75nsRSlPy8GI2fg9Q,9306
365
365
  web/server/api/endpoints/table_diff.py,sha256=8XTwgOh6QBbNy_hTM1JuHgRjbnie-pGPrphiW-FNLjQ,6058
366
- sqlmesh-0.225.1.dev7.dist-info/METADATA,sha256=gwAHhZWXqMS3xpSqUBL29wvuHE4CmomODt7q2xRYAKE,26685
367
- sqlmesh-0.225.1.dev7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
368
- sqlmesh-0.225.1.dev7.dist-info/entry_points.txt,sha256=sHAf6tQczIM8xZoduN4qaUjV7QEPVUUW_LCT8EDUMv4,155
369
- sqlmesh-0.225.1.dev7.dist-info/top_level.txt,sha256=RQ-33FPe2IgL0rgossAfJkCRtqslz9b7wFARqiWLC5Q,24
370
- sqlmesh-0.225.1.dev7.dist-info/RECORD,,
366
+ sqlmesh-0.225.1.dev8.dist-info/METADATA,sha256=6uEvh5kZJuvg6DUlb_5Cx54upb6DZI9RtDZ-Yz3HpWA,26685
367
+ sqlmesh-0.225.1.dev8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
368
+ sqlmesh-0.225.1.dev8.dist-info/entry_points.txt,sha256=sHAf6tQczIM8xZoduN4qaUjV7QEPVUUW_LCT8EDUMv4,155
369
+ sqlmesh-0.225.1.dev8.dist-info/top_level.txt,sha256=RQ-33FPe2IgL0rgossAfJkCRtqslz9b7wFARqiWLC5Q,24
370
+ sqlmesh-0.225.1.dev8.dist-info/RECORD,,