pyspiral 0.7.4__cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 0.7.6__cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.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.
Potentially problematic release.
This version of pyspiral might be problematic. Click here for more details.
- {pyspiral-0.7.4.dist-info → pyspiral-0.7.6.dist-info}/METADATA +1 -1
- {pyspiral-0.7.4.dist-info → pyspiral-0.7.6.dist-info}/RECORD +12 -12
- spiral/_lib.abi3.so +0 -0
- spiral/api/types.py +1 -0
- spiral/core/client/__init__.pyi +17 -1
- spiral/core/table/__init__.pyi +1 -1
- spiral/enrichment.py +2 -1
- spiral/expressions/__init__.py +4 -4
- spiral/project.py +28 -0
- spiral/transaction.py +10 -4
- {pyspiral-0.7.4.dist-info → pyspiral-0.7.6.dist-info}/WHEEL +0 -0
- {pyspiral-0.7.4.dist-info → pyspiral-0.7.6.dist-info}/entry_points.txt +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
pyspiral-0.7.
|
|
2
|
-
pyspiral-0.7.
|
|
3
|
-
pyspiral-0.7.
|
|
1
|
+
pyspiral-0.7.6.dist-info/METADATA,sha256=mBOLr8JlizyBr3w2oyvielfM-EdxU3vOtLG85rQpcHw,1874
|
|
2
|
+
pyspiral-0.7.6.dist-info/WHEEL,sha256=0ecHyBdkJfSXYIVmWsPh7S-4h4fSrB4FlXhlnIu9c_A,130
|
|
3
|
+
pyspiral-0.7.6.dist-info/entry_points.txt,sha256=R96Y3FpYX6XbQu9qMPfUTgiCcf4qM9OBQQZTDdBkZwA,74
|
|
4
4
|
spiral/__init__.py,sha256=PwaYBWFBtB7cYi7peMmhk_Lm5XzjRoLwOtLbUhc1ZDo,1449
|
|
5
|
-
spiral/_lib.abi3.so,sha256=
|
|
5
|
+
spiral/_lib.abi3.so,sha256=dEIf28Sm6Ur-uWeMlqzGzPMTveg3BzBUl9Iz1aP6TsU,61499608
|
|
6
6
|
spiral/adbc.py,sha256=7IxfWIeQN-fh0W5OdN_PP2x3pzQYg6ZUOLsHg3jktqw,14842
|
|
7
7
|
spiral/api/__init__.py,sha256=ULBlVq3PnfNOO6T5naE_ULmmii-83--qTuN2PpAUQN0,2241
|
|
8
8
|
spiral/api/admin.py,sha256=A1iVR1XYJSObZivPAD5UzmPuMgupXc9kaHNYYa_kwfs,585
|
|
@@ -13,7 +13,7 @@ spiral/api/organizations.py,sha256=B-8zZ7lFJANGK7dUNbo_aU-cgI959JBP9VcWb6wdgi0,1
|
|
|
13
13
|
spiral/api/projects.py,sha256=1JC7VjqZJfwR6zfhBZr3OCwaf6zb-MXMOBTE_NztmcE,6356
|
|
14
14
|
spiral/api/telemetry.py,sha256=tfdA3E_EWJwFVxkQfkm8tiYGRubnx2LuE5nbfsk1oG4,474
|
|
15
15
|
spiral/api/text_indexes.py,sha256=_zVlGBytl-9-Unbu2POfZgLh40H1YRcagFtplgIG428,1828
|
|
16
|
-
spiral/api/types.py,sha256=
|
|
16
|
+
spiral/api/types.py,sha256=HpHsoBuf7IdlXb7Dw-BkBkEvxBVIhkI8JviqhuoP9pY,696
|
|
17
17
|
spiral/api/workers.py,sha256=0wZNUHMioDT53P1OBJfpjyDfIodHwwT6858z2IlRIM4,636
|
|
18
18
|
spiral/api/workloads.py,sha256=XAyXV7vgZcoyyoPoGvOT4jTpyFKFMvrrAfhL6d1h1kE,1748
|
|
19
19
|
spiral/arrow_.py,sha256=fdSIfIs7UjDxXZlppvOW0zz86W_70Pa5pagJilH2kOE,7583
|
|
@@ -39,7 +39,7 @@ spiral/client.py,sha256=53dVv8wxYMmozUfR8MVcUufKGqdVIdb0yZ0gchczBoQ,6426
|
|
|
39
39
|
spiral/core/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
40
|
spiral/core/_tools/__init__.pyi,sha256=b2KLfTOQ67pjfbYt07o0IGiTu5o2bZw69lllV8v0Dps,143
|
|
41
41
|
spiral/core/authn/__init__.pyi,sha256=z_GWyIS62fuiYQrYO8hzw4W8oGaiciqS1u5qtAt54VY,769
|
|
42
|
-
spiral/core/client/__init__.pyi,sha256=
|
|
42
|
+
spiral/core/client/__init__.pyi,sha256=ZoeCQnEauDbaR0X7aMfHBJtLnoc7ib4JXvsmst6cAUM,6993
|
|
43
43
|
spiral/core/expr/__init__.pyi,sha256=3HSKjkotiEkxBvGBALXEBIie0JiyI9bCpehwA3nMQkU,571
|
|
44
44
|
spiral/core/expr/images/__init__.pyi,sha256=wnE_wZXq7a4iqTg3SVm-ssxGw1WQZyk5dGOPaP4Btko,73
|
|
45
45
|
spiral/core/expr/list_/__init__.pyi,sha256=Q_9c87eIQfZbqlaw_rq3fvs93YEsW7K5VYk6VZ4g6mU,126
|
|
@@ -49,7 +49,7 @@ spiral/core/expr/struct_/__init__.pyi,sha256=MXckd98eV_x3X0RhEWvlkA3DcDXRtLs5pNn
|
|
|
49
49
|
spiral/core/expr/text/__init__.pyi,sha256=ed83n1xcsGY7_QDhMmJGnSQ20UrJFXcdv1AveSEcS1c,175
|
|
50
50
|
spiral/core/expr/udf/__init__.pyi,sha256=zsZs081KVhY3-1JidqTkWMW81Qd_ScoTGZvasIhIK-4,358
|
|
51
51
|
spiral/core/expr/video/__init__.pyi,sha256=nQJEcSsigZuRpMjkI_O4EEtMK_n2zRvorcL_KEeD5vU,95
|
|
52
|
-
spiral/core/table/__init__.pyi,sha256=
|
|
52
|
+
spiral/core/table/__init__.pyi,sha256=BkjzdcY0JL97nDRoY5s2gjfdIn1CZ7TR-uYp8f6cxEw,3940
|
|
53
53
|
spiral/core/table/manifests/__init__.pyi,sha256=eVfDpmhYSjafIvvALqAkZe5baN3Y1HpKpxYEbjwd4gQ,1043
|
|
54
54
|
spiral/core/table/metastore/__init__.pyi,sha256=rc3u9MwEKRvL2kxOc8lBorddFRnM8o_o1frqtae86a4,1697
|
|
55
55
|
spiral/core/table/spec/__init__.pyi,sha256=fVuc2j3uoTdWfYNm720OfUIgrLYw9fRwj44maI5bgdY,5709
|
|
@@ -60,8 +60,8 @@ spiral/debug/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
60
60
|
spiral/debug/manifests.py,sha256=7f1O3ba9mrA5nXpOF9cEIQuUAteP5wiBkFy_diQJ7No,3216
|
|
61
61
|
spiral/debug/metrics.py,sha256=XdRDcjggtsLNGCAjam6IxG9072pz_d2C8iLApNRFUtk,2044
|
|
62
62
|
spiral/debug/scan.py,sha256=UEm_aRnql5pwDPTpZgakMLNjlzkKL4RurBFFqH_BLAQ,9526
|
|
63
|
-
spiral/enrichment.py,sha256=
|
|
64
|
-
spiral/expressions/__init__.py,sha256=
|
|
63
|
+
spiral/enrichment.py,sha256=OYOvFg98p-ti6HTw6tD6ThMGXUUKQ7JEUnqYKvMjOag,7046
|
|
64
|
+
spiral/expressions/__init__.py,sha256=ZsD8g7vB0G7xy19GUiH4m79kw7KEkTQRwJl5Gn1cgtw,8049
|
|
65
65
|
spiral/expressions/base.py,sha256=PvhJkcUSsPSIaxirHVzM9zlqyBXiaiia1HXohXdOmL4,5377
|
|
66
66
|
spiral/expressions/file.py,sha256=7D9jIENJcoT0KFharBLkzK9dZgO4DYn5K_KCt0twefg,518
|
|
67
67
|
spiral/expressions/http.py,sha256=OOHh0WBxg3vwza_m74-rkoQWSclRMI60aPAbQ6yKZi0,486
|
|
@@ -76,7 +76,7 @@ spiral/grpc_.py,sha256=f3czdP1Mxme42Y5--a5ogYq1TTiWn-J_MlGjwJ2mWwM,1015
|
|
|
76
76
|
spiral/iceberg.py,sha256=JGq62Qnf296r9_hRAoH85GQq45-uSBjwXWw_CvPi6G4,930
|
|
77
77
|
spiral/iterable_dataset.py,sha256=Eekg9ad8tcwXcloHWReBbvCSr5ZappRHn2ldKTvwqS0,4622
|
|
78
78
|
spiral/key_space_index.py,sha256=NAB_nONEjpMYbse8suz42w7Qb5OPHuKN9h9CT2NJe08,1460
|
|
79
|
-
spiral/project.py,sha256=
|
|
79
|
+
spiral/project.py,sha256=dkYc5iWZzz_HMKcu1EXUNNsI7hnEyGy8VrnKdVmKjjE,8199
|
|
80
80
|
spiral/protogen/_/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
81
81
|
spiral/protogen/_/arrow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
82
82
|
spiral/protogen/_/arrow/flight/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -104,6 +104,6 @@ spiral/streaming_/stream.py,sha256=DM1hBDHnWm1ZFKZ-hZ4zxeSXITcUI6kWzwdJZvywI8o,5
|
|
|
104
104
|
spiral/substrait_.py,sha256=AKeOD4KIXvz2J4TYxnIneOiHddtBIyOhuNxVO_uH0eg,12592
|
|
105
105
|
spiral/table.py,sha256=ep8ZYtl6POebkPViR2FrekhFazNmAbOAESoLUODlup8,12242
|
|
106
106
|
spiral/text_index.py,sha256=FQ9rgIEGLSJryS9lFdMhKtPFey18BXoWbPXyvZPJJ04,442
|
|
107
|
-
spiral/transaction.py,sha256=
|
|
107
|
+
spiral/transaction.py,sha256=bI5oqBAmPMSF0yOOYcPfGbV37Xc1-_V-wQNKw1xOlTA,4136
|
|
108
108
|
spiral/types_.py,sha256=W_jyO7F6rpPiH69jhgSgV7OxQZbOlb1Ho3InpKUP6Eo,155
|
|
109
|
-
pyspiral-0.7.
|
|
109
|
+
pyspiral-0.7.6.dist-info/RECORD,,
|
spiral/_lib.abi3.so
CHANGED
|
Binary file
|
spiral/api/types.py
CHANGED
spiral/core/client/__init__.pyi
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Any, Literal
|
|
2
2
|
|
|
3
3
|
import pyarrow as pa
|
|
4
|
-
from spiral.api.types import DatasetName, IndexName, ProjectId, RootUri, TableName
|
|
4
|
+
from spiral.api.types import DatasetName, IndexName, ProjectId, RootUri, TableId, TableName
|
|
5
5
|
from spiral.core.authn import Authn
|
|
6
6
|
from spiral.core.table import ColumnGroupState, KeyRange, KeySpaceState, Scan, ScanState, Snapshot, Table, Transaction
|
|
7
7
|
from spiral.core.table.spec import ColumnGroup, Schema
|
|
@@ -69,6 +69,22 @@ class Spiral:
|
|
|
69
69
|
"""Create a new table in the specified project."""
|
|
70
70
|
...
|
|
71
71
|
|
|
72
|
+
def move_table(
|
|
73
|
+
self,
|
|
74
|
+
table_id: TableId,
|
|
75
|
+
new_dataset: DatasetName,
|
|
76
|
+
):
|
|
77
|
+
"""Move a table to a dataset in the same project."""
|
|
78
|
+
...
|
|
79
|
+
|
|
80
|
+
def rename_table(
|
|
81
|
+
self,
|
|
82
|
+
table_id: TableId,
|
|
83
|
+
new_table: TableName,
|
|
84
|
+
):
|
|
85
|
+
"""Rename a table."""
|
|
86
|
+
...
|
|
87
|
+
|
|
72
88
|
def text_index(self, index_id: str) -> TextIndex:
|
|
73
89
|
"""Get a text index."""
|
|
74
90
|
...
|
spiral/core/table/__init__.pyi
CHANGED
|
@@ -115,7 +115,7 @@ class Transaction:
|
|
|
115
115
|
def ops(self) -> list[Operation]: ...
|
|
116
116
|
def take(self) -> list[Operation]: ...
|
|
117
117
|
def include(self, ops: list[Operation]): ...
|
|
118
|
-
def commit(self): ...
|
|
118
|
+
def commit(self, *, compact: bool = False): ...
|
|
119
119
|
def abort(self): ...
|
|
120
120
|
def is_empty(self) -> bool: ...
|
|
121
121
|
def metrics(self) -> dict[str, Any]: ...
|
spiral/enrichment.py
CHANGED
|
@@ -151,7 +151,8 @@ class Enrichment:
|
|
|
151
151
|
logger.warning("Transaction not committed. No rows were read for enrichment.")
|
|
152
152
|
return
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
# Always compact in distributed enrichment.
|
|
155
|
+
tx.commit(compact=True, tx_dump=tx_dump)
|
|
155
156
|
|
|
156
157
|
|
|
157
158
|
@dataclasses.dataclass
|
spiral/expressions/__init__.py
CHANGED
|
@@ -131,10 +131,10 @@ def evaluate(expr: ExprLike) -> pa.RecordBatchReader:
|
|
|
131
131
|
if isinstance(expr, pa.Array):
|
|
132
132
|
raise ValueError("Arrow array must be a struct array.")
|
|
133
133
|
|
|
134
|
-
if isinstance(expr, Expr):
|
|
135
|
-
raise NotImplementedError(
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
if isinstance(expr, Expr) or isinstance(expr, NativeExpr):
|
|
135
|
+
raise NotImplementedError(
|
|
136
|
+
"Expr evaluation not supported yet. Use Arrow to write instead. Reach out if you require this feature."
|
|
137
|
+
)
|
|
138
138
|
|
|
139
139
|
if isinstance(expr, dict):
|
|
140
140
|
# NOTE: we assume this is a struct expression. We could be smarter and be context aware to determine if
|
spiral/project.py
CHANGED
|
@@ -89,6 +89,34 @@ class Project:
|
|
|
89
89
|
|
|
90
90
|
return Table(self._spiral, core_table, identifier=f"{self._id}.{dataset}.{table}")
|
|
91
91
|
|
|
92
|
+
def move_table(self, identifier: str, new_dataset: str):
|
|
93
|
+
"""Move a table to a new dataset in the project.
|
|
94
|
+
|
|
95
|
+
Args:
|
|
96
|
+
identifier: The table identifier, in the form `dataset.table` or `table`.
|
|
97
|
+
new_dataset: The dataset into which to move this table.
|
|
98
|
+
"""
|
|
99
|
+
table = self.table(identifier)
|
|
100
|
+
|
|
101
|
+
self._spiral.core.move_table(
|
|
102
|
+
table_id=table.table_id,
|
|
103
|
+
new_dataset=new_dataset,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
def rename_table(self, identifier: str, new_table: str):
|
|
107
|
+
"""Move a table to a new dataset in the project.
|
|
108
|
+
|
|
109
|
+
Args:
|
|
110
|
+
identifier: The table identifier, in the form `dataset.table` or `table`.
|
|
111
|
+
new_dataset: The dataset into which to move this table.
|
|
112
|
+
"""
|
|
113
|
+
table = self.table(identifier)
|
|
114
|
+
|
|
115
|
+
self._spiral.core.rename_table(
|
|
116
|
+
table_id=table.table_id,
|
|
117
|
+
new_table=new_table,
|
|
118
|
+
)
|
|
119
|
+
|
|
92
120
|
def _parse_table_identifier(self, identifier: str) -> tuple[str, str]:
|
|
93
121
|
parts = identifier.split(".")
|
|
94
122
|
if len(parts) == 1:
|
spiral/transaction.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
from pathlib import Path
|
|
2
3
|
|
|
3
4
|
from spiral.core.table import KeyRange
|
|
4
5
|
from spiral.core.table import Transaction as CoreTransaction
|
|
@@ -95,18 +96,23 @@ class Transaction:
|
|
|
95
96
|
"""
|
|
96
97
|
self._core.include(ops)
|
|
97
98
|
|
|
98
|
-
def commit(self, *, tx_dump: str | None = None):
|
|
99
|
+
def commit(self, *, compact: bool = False, tx_dump: str | None = None):
|
|
99
100
|
"""Commit the transaction."""
|
|
100
|
-
# TODO(marko): We can remove this when I have more trust in large tx commits.
|
|
101
101
|
if tx_dump is not None:
|
|
102
102
|
try:
|
|
103
|
-
|
|
103
|
+
# Create parent directories if they don't exist
|
|
104
|
+
dump_path = Path(tx_dump)
|
|
105
|
+
dump_path.parent.mkdir(parents=True, exist_ok=True)
|
|
106
|
+
|
|
107
|
+
# Write operations to file
|
|
108
|
+
with open(dump_path, "w") as f:
|
|
104
109
|
f.writelines([op.to_json() for op in self._core.ops()])
|
|
110
|
+
|
|
105
111
|
logger.info(f"Transaction dumped to {tx_dump}")
|
|
106
112
|
except Exception as e:
|
|
107
113
|
logger.error(f"Failed to dump transaction to {tx_dump}: {e}")
|
|
108
114
|
|
|
109
|
-
self._core.commit()
|
|
115
|
+
self._core.commit(compact=compact)
|
|
110
116
|
|
|
111
117
|
def abort(self):
|
|
112
118
|
"""Abort the transaction."""
|
|
File without changes
|
|
File without changes
|