spice-mcp 0.1.2__py3-none-any.whl → 0.1.3__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.
@@ -2,9 +2,11 @@
2
2
 
3
3
  This module provides a thin façade used by the new service layer while
4
4
  keeping the battle-tested logic that the original spice client offered.
5
+
6
+ Only synchronous interfaces are exposed.
5
7
  """
6
8
 
7
9
  from . import urls # re-export for callers needing low-level helpers
8
- from .extract import async_query, query # noqa: F401
10
+ from .extract import query # noqa: F401
9
11
 
10
- __all__ = ["query", "async_query", "urls"]
12
+ __all__ = ["query", "urls"]
@@ -51,39 +51,7 @@ def load_from_cache(
51
51
  return None, execution
52
52
 
53
53
 
54
- async def async_load_from_cache(
55
- execute_kwargs: _extract.ExecuteKwargs,
56
- result_kwargs: _extract.RetrievalKwargs,
57
- output_kwargs: _extract.OutputKwargs,
58
- ) -> tuple[
59
- pl.DataFrame | tuple[pl.DataFrame, Execution] | None, Execution | None
60
- ]:
61
- # get latest execution
62
- execution = await _extract.async_get_latest_execution(execute_kwargs)
63
- if execution is None:
64
- return None, None
65
-
66
- # build cache path
67
- cache_path = _build_cache_path(
68
- execution=execution,
69
- execute_kwargs=execute_kwargs,
70
- result_kwargs=result_kwargs,
71
- cache_dir=output_kwargs['cache_dir'],
72
- )
73
-
74
- # load cache result
75
- if os.path.exists(cache_path):
76
- import polars as pl
77
-
78
- if result_kwargs['verbose']:
79
- print('loading dune query result from cache')
80
- df = await pl.scan_parquet(cache_path).collect_async()
81
- if output_kwargs['include_execution']:
82
- return (df, execution), execution
83
- else:
84
- return df, execution
85
- else:
86
- return None, execution
54
+ ## Removed async cache loader; synchronous load_from_cache should be used exclusively.
87
55
 
88
56
 
89
57
  def save_to_cache(
@@ -113,7 +81,7 @@ def save_to_cache(
113
81
  # save to cache
114
82
  tmp_path = (
115
83
  cache_path + '_tmp_' + secrets.token_hex(8)
116
- ) # add for if running in parallel
84
+ ) # add tmp suffix to avoid conflicts during writes
117
85
  df.write_parquet(tmp_path)
118
86
  shutil.move(tmp_path, cache_path)
119
87