pyspiral 0.4.4__cp310-abi3-macosx_11_0_arm64.whl → 0.6.0__cp310-abi3-macosx_11_0_arm64.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.
Files changed (85) hide show
  1. {pyspiral-0.4.4.dist-info → pyspiral-0.6.0.dist-info}/METADATA +10 -5
  2. pyspiral-0.6.0.dist-info/RECORD +99 -0
  3. {pyspiral-0.4.4.dist-info → pyspiral-0.6.0.dist-info}/WHEEL +1 -1
  4. spiral/__init__.py +10 -3
  5. spiral/_lib.abi3.so +0 -0
  6. spiral/adbc.py +29 -11
  7. spiral/api/__init__.py +14 -0
  8. spiral/api/client.py +5 -1
  9. spiral/api/key_space_indexes.py +23 -0
  10. spiral/api/projects.py +17 -2
  11. spiral/api/text_indexes.py +56 -0
  12. spiral/api/types.py +2 -0
  13. spiral/api/workers.py +40 -0
  14. spiral/cli/__init__.py +15 -6
  15. spiral/cli/admin.py +2 -4
  16. spiral/cli/app.py +4 -2
  17. spiral/cli/fs.py +5 -6
  18. spiral/cli/iceberg.py +97 -0
  19. spiral/cli/key_spaces.py +68 -0
  20. spiral/cli/login.py +6 -7
  21. spiral/cli/orgs.py +7 -8
  22. spiral/cli/printer.py +3 -3
  23. spiral/cli/projects.py +5 -6
  24. spiral/cli/tables.py +131 -0
  25. spiral/cli/telemetry.py +3 -4
  26. spiral/cli/text.py +115 -0
  27. spiral/cli/types.py +3 -4
  28. spiral/cli/workloads.py +7 -8
  29. spiral/client.py +111 -8
  30. spiral/core/authn/__init__.pyi +27 -0
  31. spiral/core/client/__init__.pyi +135 -63
  32. spiral/core/table/__init__.pyi +36 -26
  33. spiral/core/table/metastore/__init__.pyi +0 -4
  34. spiral/core/table/spec/__init__.pyi +0 -2
  35. spiral/{tables/dataset.py → dataset.py} +13 -7
  36. spiral/{tables/debug → debug}/manifests.py +17 -6
  37. spiral/{tables/debug → debug}/scan.py +7 -7
  38. spiral/expressions/base.py +3 -3
  39. spiral/expressions/udf.py +1 -1
  40. spiral/{iceberg/client.py → iceberg.py} +1 -3
  41. spiral/key_space_index.py +44 -0
  42. spiral/project.py +171 -18
  43. spiral/protogen/_/arrow/flight/protocol/sql/__init__.py +1668 -1110
  44. spiral/protogen/_/google/protobuf/__init__.py +2190 -0
  45. spiral/protogen/_/message_pool.py +3 -0
  46. spiral/protogen/_/py.typed +0 -0
  47. spiral/protogen/_/scandal/__init__.py +138 -126
  48. spiral/protogen/_/spfs/__init__.py +72 -0
  49. spiral/protogen/_/spql/__init__.py +61 -0
  50. spiral/protogen/_/substrait/__init__.py +5256 -2459
  51. spiral/protogen/_/substrait/extensions/__init__.py +103 -49
  52. spiral/{tables/scan.py → scan.py} +37 -44
  53. spiral/settings.py +14 -3
  54. spiral/snapshot.py +55 -0
  55. spiral/streaming_/__init__.py +3 -0
  56. spiral/streaming_/reader.py +117 -0
  57. spiral/streaming_/stream.py +146 -0
  58. spiral/substrait_.py +9 -9
  59. spiral/table.py +257 -0
  60. spiral/text_index.py +17 -0
  61. spiral/{tables/transaction.py → transaction.py} +11 -15
  62. pyspiral-0.4.4.dist-info/RECORD +0 -98
  63. spiral/cli/iceberg/__init__.py +0 -7
  64. spiral/cli/iceberg/namespaces.py +0 -47
  65. spiral/cli/iceberg/tables.py +0 -60
  66. spiral/cli/indexes/__init__.py +0 -19
  67. spiral/cli/tables/__init__.py +0 -121
  68. spiral/core/index/__init__.pyi +0 -15
  69. spiral/iceberg/__init__.py +0 -3
  70. spiral/indexes/__init__.py +0 -5
  71. spiral/indexes/client.py +0 -137
  72. spiral/indexes/index.py +0 -34
  73. spiral/indexes/scan.py +0 -22
  74. spiral/protogen/_/spiral/table/__init__.py +0 -22
  75. spiral/protogen/substrait/__init__.py +0 -3399
  76. spiral/protogen/substrait/extensions/__init__.py +0 -115
  77. spiral/tables/__init__.py +0 -12
  78. spiral/tables/client.py +0 -130
  79. spiral/tables/maintenance.py +0 -12
  80. spiral/tables/snapshot.py +0 -78
  81. spiral/tables/table.py +0 -145
  82. {pyspiral-0.4.4.dist-info → pyspiral-0.6.0.dist-info}/entry_points.txt +0 -0
  83. /spiral/{protogen/_/spiral → debug}/__init__.py +0 -0
  84. /spiral/{tables/debug → debug}/metrics.py +0 -0
  85. /spiral/{tables/debug → protogen/_/google}/__init__.py +0 -0
@@ -0,0 +1,3 @@
1
+ import betterproto2
2
+
3
+ default_message_pool = betterproto2.MessagePool()
File without changes
@@ -1,178 +1,190 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # sources: scandal/scandal.proto
3
- # plugin: python-betterproto
3
+ # plugin: python-betterproto2
4
4
  # This file has been @generated
5
5
 
6
- from dataclasses import dataclass
7
- from typing import (
8
- TYPE_CHECKING,
9
- Dict,
10
- List,
11
- Optional,
6
+ __all__ = (
7
+ "Connectivity",
8
+ "Fetch",
9
+ "FetchRequest",
10
+ "FetchResponse",
11
+ "Metadata",
12
+ "MetadataParquet",
13
+ "Put",
14
+ "PutRequest",
15
+ "PutResponse",
16
+ "ScandalServiceStub",
17
+ "Sink",
18
+ "Source",
12
19
  )
13
20
 
14
- import betterproto
15
- import grpclib
16
- from betterproto.grpc.grpclib_server import ServiceBase
21
+ from dataclasses import dataclass
22
+
23
+ import betterproto2
24
+ import grpc
17
25
 
26
+ from ..message_pool import default_message_pool
18
27
 
19
- if TYPE_CHECKING:
20
- import grpclib.server
21
- from betterproto.grpc.grpclib_client import MetadataLike
22
- from grpclib.metadata import Deadline
28
+ _COMPILER_VERSION = "0.8.0"
29
+ betterproto2.check_compiler_version(_COMPILER_VERSION)
23
30
 
24
31
 
25
32
  @dataclass(eq=False, repr=False)
26
- class Source(betterproto.Message):
27
- url: str = betterproto.string_field(1)
28
- content_type: Optional[str] = betterproto.string_field(2, optional=True)
29
- size: Optional[int] = betterproto.int64_field(3, optional=True)
30
- parquet: "MetadataParquet" = betterproto.message_field(10, group="metadata")
33
+ class Connectivity(betterproto2.Message):
34
+ """
35
+ Information about the client's perceived connectivity to a FileSystem.
36
+ """
31
37
 
38
+ unreachable: "bool" = betterproto2.field(1, betterproto2.TYPE_BOOL)
39
+
40
+ round_trip_time_us: "int | None" = betterproto2.field(2, betterproto2.TYPE_INT32, optional=True)
32
41
 
33
- @dataclass(eq=False, repr=False)
34
- class Metadata(betterproto.Message):
35
- pass
42
+
43
+ default_message_pool.register_message("scandal", "Connectivity", Connectivity)
36
44
 
37
45
 
38
46
  @dataclass(eq=False, repr=False)
39
- class MetadataParquet(betterproto.Message):
47
+ class Fetch(betterproto2.Message):
48
+ """
49
+ Let's make "fetch" happen.
50
+ """
51
+
40
52
  pass
41
53
 
42
54
 
43
- @dataclass(eq=False, repr=False)
44
- class Sink(betterproto.Message):
45
- url: str = betterproto.string_field(1)
55
+ default_message_pool.register_message("scandal", "Fetch", Fetch)
46
56
 
47
57
 
48
58
  @dataclass(eq=False, repr=False)
49
- class Connectivity(betterproto.Message):
59
+ class FetchRequest(betterproto2.Message):
50
60
  """
51
- Information about the client's perceived connectivity to a FileSystem.
61
+ TODO(ngates): include projection expression.
62
+ """
63
+
64
+ uri: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)
65
+ """
66
+ A signed request to read an
67
+ spfs://<fsid>/path?token=<jwt&gt URI.
52
68
  """
53
69
 
54
- unreachable: bool = betterproto.bool_field(1)
55
- round_trip_time_us: Optional[int] = betterproto.int32_field(2, optional=True)
70
+ connectivity: "Connectivity | None" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, optional=True)
71
+ """
72
+ Declares whether the client has connectivity to the FileSystem.
73
+ """
56
74
 
75
+ accepts: "list[str]" = betterproto2.field(3, betterproto2.TYPE_STRING, repeated=True)
76
+ """
77
+ Declares the MIME types the client can read directly.
78
+ """
57
79
 
58
- @dataclass(eq=False, repr=False)
59
- class Fetch(betterproto.Message):
60
- """Let's make "fetch" happen."""
61
80
 
62
- pass
81
+ default_message_pool.register_message("scandal", "Fetch.Request", FetchRequest)
63
82
 
64
83
 
65
84
  @dataclass(eq=False, repr=False)
66
- class FetchRequest(betterproto.Message):
67
- """TODO(ngates): include projection expression."""
68
-
69
- uri: str = betterproto.string_field(1)
85
+ class FetchResponse(betterproto2.Message):
86
+ sources: "list[Source]" = betterproto2.field(1, betterproto2.TYPE_MESSAGE, repeated=True)
70
87
  """
71
- A signed request to read an
72
- spfs://<fsid>/path?token=<jwt&gt URI.
88
+ The sources the client should use to attempt to read the file.
89
+ The client should try each source in order until it finds one that works.
73
90
  """
74
91
 
75
- connectivity: "Connectivity" = betterproto.message_field(2)
76
- """Declares whether the client has connectivity to the FileSystem."""
77
92
 
78
- accepts: List[str] = betterproto.string_field(3)
79
- """Declares the MIME types the client can read directly."""
93
+ default_message_pool.register_message("scandal", "Fetch.Response", FetchResponse)
94
+
95
+
96
+ @dataclass(eq=False, repr=False)
97
+ class Metadata(betterproto2.Message):
98
+ pass
99
+
100
+
101
+ default_message_pool.register_message("scandal", "Metadata", Metadata)
80
102
 
81
103
 
82
104
  @dataclass(eq=False, repr=False)
83
- class FetchResponse(betterproto.Message):
84
- sources: List["Source"] = betterproto.message_field(1)
105
+ class MetadataParquet(betterproto2.Message):
85
106
  """
86
- The sources the client should use to attempt to read the file.
87
- The client should try each source in order until it finds one that works.
107
+ A bunch of optional metadata that the client can use
108
+ to accelerate reading the file.
88
109
  """
89
110
 
111
+ pass
112
+
113
+
114
+ default_message_pool.register_message("scandal", "Metadata.Parquet", MetadataParquet)
115
+
90
116
 
91
117
  @dataclass(eq=False, repr=False)
92
- class Put(betterproto.Message):
118
+ class Put(betterproto2.Message):
93
119
  pass
94
120
 
95
121
 
122
+ default_message_pool.register_message("scandal", "Put", Put)
123
+
124
+
96
125
  @dataclass(eq=False, repr=False)
97
- class PutRequest(betterproto.Message):
98
- uri: str = betterproto.string_field(1)
99
- connectivity: "Connectivity" = betterproto.message_field(2)
126
+ class PutRequest(betterproto2.Message):
127
+ uri: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)
128
+
129
+ connectivity: "Connectivity | None" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, optional=True)
130
+
131
+
132
+ default_message_pool.register_message("scandal", "Put.Request", PutRequest)
133
+
134
+
135
+ @dataclass(eq=False, repr=False)
136
+ class PutResponse(betterproto2.Message):
137
+ sinks: "list[Sink]" = betterproto2.field(1, betterproto2.TYPE_MESSAGE, repeated=True)
138
+
139
+
140
+ default_message_pool.register_message("scandal", "Put.Response", PutResponse)
100
141
 
101
142
 
102
143
  @dataclass(eq=False, repr=False)
103
- class PutResponse(betterproto.Message):
104
- sinks: List["Sink"] = betterproto.message_field(1)
105
-
106
-
107
- class ScandalServiceStub(betterproto.ServiceStub):
108
- async def fetch(
109
- self,
110
- fetch_request: "FetchRequest",
111
- *,
112
- timeout: Optional[float] = None,
113
- deadline: Optional["Deadline"] = None,
114
- metadata: Optional["MetadataLike"] = None
115
- ) -> "FetchResponse":
116
- return await self._unary_unary(
144
+ class Sink(betterproto2.Message):
145
+ url: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)
146
+
147
+
148
+ default_message_pool.register_message("scandal", "Sink", Sink)
149
+
150
+
151
+ @dataclass(eq=False, repr=False)
152
+ class Source(betterproto2.Message):
153
+ """
154
+ NOTE(marko): Scandal does not yet exist and this file is unused.
155
+
156
+ Oneofs:
157
+ - metadata:
158
+ """
159
+
160
+ url: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)
161
+
162
+ content_type: "str | None" = betterproto2.field(2, betterproto2.TYPE_STRING, optional=True)
163
+
164
+ size: "int | None" = betterproto2.field(3, betterproto2.TYPE_INT64, optional=True)
165
+
166
+ parquet: "MetadataParquet | None" = betterproto2.field(
167
+ 10, betterproto2.TYPE_MESSAGE, optional=True, group="metadata"
168
+ )
169
+
170
+
171
+ default_message_pool.register_message("scandal", "Source", Source)
172
+
173
+
174
+ class ScandalServiceStub:
175
+ def __init__(self, channel: grpc.Channel):
176
+ self._channel = channel
177
+
178
+ def fetch(self, message: "FetchRequest") -> "FetchResponse":
179
+ return self._channel.unary_unary(
117
180
  "/scandal.ScandalService/Fetch",
118
- fetch_request,
119
- FetchResponse,
120
- timeout=timeout,
121
- deadline=deadline,
122
- metadata=metadata,
123
- )
124
-
125
- async def put(
126
- self,
127
- put_request: "PutRequest",
128
- *,
129
- timeout: Optional[float] = None,
130
- deadline: Optional["Deadline"] = None,
131
- metadata: Optional["MetadataLike"] = None
132
- ) -> "PutResponse":
133
- return await self._unary_unary(
181
+ FetchRequest.SerializeToString,
182
+ FetchResponse.FromString,
183
+ )(message)
184
+
185
+ def put(self, message: "PutRequest") -> "PutResponse":
186
+ return self._channel.unary_unary(
134
187
  "/scandal.ScandalService/Put",
135
- put_request,
136
- PutResponse,
137
- timeout=timeout,
138
- deadline=deadline,
139
- metadata=metadata,
140
- )
141
-
142
-
143
- class ScandalServiceBase(ServiceBase):
144
- async def fetch(self, fetch_request: "FetchRequest") -> "FetchResponse":
145
- raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)
146
-
147
- async def put(self, put_request: "PutRequest") -> "PutResponse":
148
- raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)
149
-
150
- async def __rpc_fetch(
151
- self, stream: "grpclib.server.Stream[FetchRequest, FetchResponse]"
152
- ) -> None:
153
- request = await stream.recv_message()
154
- response = await self.fetch(request)
155
- await stream.send_message(response)
156
-
157
- async def __rpc_put(
158
- self, stream: "grpclib.server.Stream[PutRequest, PutResponse]"
159
- ) -> None:
160
- request = await stream.recv_message()
161
- response = await self.put(request)
162
- await stream.send_message(response)
163
-
164
- def __mapping__(self) -> Dict[str, grpclib.const.Handler]:
165
- return {
166
- "/scandal.ScandalService/Fetch": grpclib.const.Handler(
167
- self.__rpc_fetch,
168
- grpclib.const.Cardinality.UNARY_UNARY,
169
- FetchRequest,
170
- FetchResponse,
171
- ),
172
- "/scandal.ScandalService/Put": grpclib.const.Handler(
173
- self.__rpc_put,
174
- grpclib.const.Cardinality.UNARY_UNARY,
175
- PutRequest,
176
- PutResponse,
177
- ),
178
- }
188
+ PutRequest.SerializeToString,
189
+ PutResponse.FromString,
190
+ )(message)
@@ -0,0 +1,72 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # sources: spfs/metadata.proto
3
+ # plugin: python-betterproto2
4
+ # This file has been @generated
5
+
6
+ __all__ = (
7
+ "FileMetadata",
8
+ "ParquetFileSpecificMetadata",
9
+ "ProtobufFileSpecificMetadata",
10
+ "VortexFileSpecificMetadata",
11
+ )
12
+
13
+ from dataclasses import dataclass
14
+
15
+ import betterproto2
16
+
17
+ from ..message_pool import default_message_pool
18
+
19
+ _COMPILER_VERSION = "0.8.0"
20
+ betterproto2.check_compiler_version(_COMPILER_VERSION)
21
+
22
+
23
+ @dataclass(eq=False, repr=False)
24
+ class FileMetadata(betterproto2.Message):
25
+ """
26
+
27
+
28
+ Oneofs:
29
+ - format_specific:
30
+ """
31
+
32
+ protobuf: "ProtobufFileSpecificMetadata | None" = betterproto2.field(
33
+ 1, betterproto2.TYPE_MESSAGE, optional=True, group="format_specific"
34
+ )
35
+
36
+ parquet: "ParquetFileSpecificMetadata | None" = betterproto2.field(
37
+ 2, betterproto2.TYPE_MESSAGE, optional=True, group="format_specific"
38
+ )
39
+
40
+ vortex: "VortexFileSpecificMetadata | None" = betterproto2.field(
41
+ 3, betterproto2.TYPE_MESSAGE, optional=True, group="format_specific"
42
+ )
43
+
44
+
45
+ default_message_pool.register_message("spfs", "FileMetadata", FileMetadata)
46
+
47
+
48
+ @dataclass(eq=False, repr=False)
49
+ class ParquetFileSpecificMetadata(betterproto2.Message):
50
+ metadata_size_bytes: "int" = betterproto2.field(1, betterproto2.TYPE_UINT32)
51
+
52
+
53
+ default_message_pool.register_message("spfs", "ParquetFileSpecificMetadata", ParquetFileSpecificMetadata)
54
+
55
+
56
+ @dataclass(eq=False, repr=False)
57
+ class ProtobufFileSpecificMetadata(betterproto2.Message):
58
+ pass
59
+
60
+
61
+ default_message_pool.register_message("spfs", "ProtobufFileSpecificMetadata", ProtobufFileSpecificMetadata)
62
+
63
+
64
+ @dataclass(eq=False, repr=False)
65
+ class VortexFileSpecificMetadata(betterproto2.Message):
66
+ footer: "bytes | None" = betterproto2.field(2, betterproto2.TYPE_BYTES, optional=True)
67
+ """
68
+ Optional because we may decide to not store it if it's too large.
69
+ """
70
+
71
+
72
+ default_message_pool.register_message("spfs", "VortexFileSpecificMetadata", VortexFileSpecificMetadata)
@@ -0,0 +1,61 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # sources: spql/exprs.proto
3
+ # plugin: python-betterproto2
4
+ # This file has been @generated
5
+
6
+ __all__ = (
7
+ "BoostOpts",
8
+ "FindOpts",
9
+ "IndexOpts",
10
+ "TableOpts",
11
+ "TextDTypeOpts",
12
+ )
13
+
14
+ from dataclasses import dataclass
15
+
16
+ import betterproto2
17
+
18
+ from ..message_pool import default_message_pool
19
+
20
+ _COMPILER_VERSION = "0.8.0"
21
+ betterproto2.check_compiler_version(_COMPILER_VERSION)
22
+
23
+
24
+ @dataclass(eq=False, repr=False)
25
+ class BoostOpts(betterproto2.Message):
26
+ factor: "float" = betterproto2.field(1, betterproto2.TYPE_FLOAT)
27
+
28
+
29
+ default_message_pool.register_message("spql", "BoostOpts", BoostOpts)
30
+
31
+
32
+ @dataclass(eq=False, repr=False)
33
+ class FindOpts(betterproto2.Message):
34
+ term: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)
35
+
36
+
37
+ default_message_pool.register_message("spql", "FindOpts", FindOpts)
38
+
39
+
40
+ @dataclass(eq=False, repr=False)
41
+ class IndexOpts(betterproto2.Message):
42
+ index_id: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)
43
+
44
+
45
+ default_message_pool.register_message("spql", "IndexOpts", IndexOpts)
46
+
47
+
48
+ @dataclass(eq=False, repr=False)
49
+ class TableOpts(betterproto2.Message):
50
+ table_id: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)
51
+
52
+
53
+ default_message_pool.register_message("spql", "TableOpts", TableOpts)
54
+
55
+
56
+ @dataclass(eq=False, repr=False)
57
+ class TextDTypeOpts(betterproto2.Message):
58
+ tokenizer: "str | None" = betterproto2.field(1, betterproto2.TYPE_STRING, optional=True)
59
+
60
+
61
+ default_message_pool.register_message("spql", "TextDTypeOpts", TextDTypeOpts)