vgi-python 0.31.2__py3-none-any.whl → 0.31.4__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.
Files changed (63) hide show
  1. vgi/__init__.py +82 -0
  2. vgi/_test_fixtures/accumulate/worker.py +1 -1
  3. vgi/_test_fixtures/attach_options.py +1 -1
  4. vgi/_test_fixtures/bad_enum.py +2 -2
  5. vgi/_test_fixtures/catalog.py +80 -77
  6. vgi/_test_fixtures/companion.py +5 -5
  7. vgi/_test_fixtures/narrow_bind/worker.py +10 -10
  8. vgi/_test_fixtures/orchard_catalog.py +2 -2
  9. vgi/_test_fixtures/projection_repro/worker.py +10 -10
  10. vgi/_test_fixtures/scalar/__init__.py +2 -0
  11. vgi/_test_fixtures/scalar/arithmetic.py +28 -0
  12. vgi/_test_fixtures/scalar/null_handling.py +2 -1
  13. vgi/_test_fixtures/schema_reconcile/worker.py +18 -18
  14. vgi/_test_fixtures/simple_writable.py +35 -32
  15. vgi/_test_fixtures/table/filters.py +33 -11
  16. vgi/_test_fixtures/table/late_materialization.py +5 -1
  17. vgi/_test_fixtures/table/same_name_schemas.py +3 -3
  18. vgi/_test_fixtures/table/splits.py +5 -1
  19. vgi/_test_fixtures/table/tt_pushdown.py +5 -1
  20. vgi/_test_fixtures/table_in_out_same_name.py +1 -1
  21. vgi/_test_fixtures/twin_catalogs.py +1 -1
  22. vgi/_test_fixtures/versioned.py +1 -1
  23. vgi/_test_fixtures/versioned_tables.py +15 -15
  24. vgi/_test_fixtures/worker.py +89 -71
  25. vgi/_test_fixtures/writable/generic.py +1 -1
  26. vgi/_test_fixtures/writable/worker.py +91 -85
  27. vgi/aggregate_function.py +9 -0
  28. vgi/argument_spec.py +80 -2
  29. vgi/attach_header.py +1 -1
  30. vgi/catalog/__init__.py +2 -0
  31. vgi/catalog/catalog_interface.py +267 -172
  32. vgi/catalog/descriptors.py +61 -61
  33. vgi/catalog/duckdb_statistics.py +10 -10
  34. vgi/client/aggregate.py +27 -27
  35. vgi/client/catalog_mixin.py +158 -103
  36. vgi/client/cli.py +8 -7
  37. vgi/client/cli_schema.py +20 -19
  38. vgi/client/cli_table.py +56 -55
  39. vgi/client/cli_utils.py +35 -4
  40. vgi/client/cli_view.py +21 -20
  41. vgi/client/client.py +363 -48
  42. vgi/filter_v2.py +1261 -0
  43. vgi/filter_v2_builder.py +140 -0
  44. vgi/http/worker_page.py +16 -10
  45. vgi/meta_worker.py +12 -11
  46. vgi/metadata.py +221 -10
  47. vgi/protocol.py +180 -109
  48. vgi/protocol_version.txt +1 -1
  49. vgi/scalar_function.py +10 -0
  50. vgi/schema_path.py +58 -0
  51. vgi/serve.py +155 -2
  52. vgi/split_token.py +1 -1
  53. vgi/table_filter_pushdown.py +190 -333
  54. vgi/table_function.py +19 -2
  55. vgi/table_in_out_function.py +12 -1
  56. vgi/transactor/protocol.py +14 -8
  57. vgi/transactor/server.py +41 -17
  58. vgi/worker.py +404 -162
  59. {vgi_python-0.31.2.dist-info → vgi_python-0.31.4.dist-info}/METADATA +6 -4
  60. {vgi_python-0.31.2.dist-info → vgi_python-0.31.4.dist-info}/RECORD +63 -60
  61. {vgi_python-0.31.2.dist-info → vgi_python-0.31.4.dist-info}/WHEEL +0 -0
  62. {vgi_python-0.31.2.dist-info → vgi_python-0.31.4.dist-info}/entry_points.txt +0 -0
  63. {vgi_python-0.31.2.dist-info → vgi_python-0.31.4.dist-info}/licenses/LICENSE +0 -0
vgi/__init__.py CHANGED
@@ -26,6 +26,7 @@ from vgi.argument_spec import (
26
26
  VGI_VARARGS_TRUE,
27
27
  ArgumentSpec,
28
28
  argument_specs_to_schema,
29
+ parameter_default_values_from_specs,
29
30
  schema_to_argument_specs,
30
31
  )
31
32
  from vgi.arguments import (
@@ -42,13 +43,54 @@ from vgi.arguments import (
42
43
  TaggedUnion,
43
44
  )
44
45
  from vgi.auth import AuthContext, CallContext
46
+ from vgi.filter_v2 import (
47
+ Arithmetic,
48
+ ArithmeticOperator,
49
+ BooleanExpression,
50
+ Call,
51
+ Cast,
52
+ ColumnRef,
53
+ Comparison,
54
+ ComparisonOperator,
55
+ EvaluationContext,
56
+ ExternalSet,
57
+ FieldRef,
58
+ FilterPredicate,
59
+ FilterState,
60
+ FilterV2Error,
61
+ FunctionIdentity,
62
+ In,
63
+ IsNull,
64
+ Literal,
65
+ LiteralSet,
66
+ Negate,
67
+ Not,
68
+ PredicateMode,
69
+ PredicateSource,
70
+ RuntimeFilter,
71
+ StandardFilterFunction,
72
+ )
73
+ from vgi.filter_v2_builder import (
74
+ FilterPayload,
75
+ artifact_payload,
76
+ build_filter_batch,
77
+ deserialize_filter_batch,
78
+ serialize_filter_batch,
79
+ type_payload,
80
+ value_payload,
81
+ )
45
82
  from vgi.metadata import (
83
+ ArgumentMonotonicity,
46
84
  CatalogFunctionType,
85
+ EvaluationContextCapability,
86
+ FilterFunctionCapability,
87
+ FilterSemanticProfile,
47
88
  FunctionExample,
48
89
  FunctionStability,
49
90
  OrderPreservation,
50
91
  ParameterInfo,
51
92
  ResolvedMetadata,
93
+ RuntimeFilterAlgorithmCapability,
52
94
  TableInputValidationError,
53
95
  functions_to_arrow,
54
96
  )
@@ -65,6 +107,7 @@ from vgi.scalar_function import (
65
107
  ScalarFunctionGenerator,
66
108
  TypeMismatchError,
67
109
  )
110
+ from vgi.schema_path import SchemaPath
68
111
  from vgi.schema_utils import schema, schema_like
69
112
  from vgi.table_filter_pushdown import (
70
113
  ColumnBounds,
@@ -96,10 +139,12 @@ __all__ = [
96
139
  "ArgumentSpec",
97
140
  "ArgumentValidationError",
98
141
  "Arguments",
142
+ "ArgumentMonotonicity",
99
143
  "Auth",
100
144
  "AuthContext",
101
145
  "CallContext",
102
146
  "argument_specs_to_schema",
147
+ "parameter_default_values_from_specs",
103
148
  "BindRequest",
104
149
  "ColumnBounds",
105
150
  "ColumnRefNode",
@@ -130,6 +175,42 @@ __all__ = [
130
175
  "FunctionExample",
131
176
  "FunctionStability",
132
177
  "CatalogFunctionType",
178
+ "FilterSemanticProfile",
179
+ "FilterFunctionCapability",
180
+ "RuntimeFilterAlgorithmCapability",
181
+ "EvaluationContextCapability",
182
+ "FilterV2Error",
183
+ "FilterState",
184
+ "FilterPredicate",
185
+ "PredicateMode",
186
+ "PredicateSource",
187
+ "EvaluationContext",
188
+ "ColumnRef",
189
+ "FieldRef",
190
+ "Literal",
191
+ "Comparison",
192
+ "ComparisonOperator",
193
+ "BooleanExpression",
194
+ "Not",
195
+ "IsNull",
196
+ "LiteralSet",
197
+ "ExternalSet",
198
+ "In",
199
+ "Cast",
200
+ "Arithmetic",
201
+ "ArithmeticOperator",
202
+ "Negate",
203
+ "Call",
204
+ "FunctionIdentity",
205
+ "StandardFilterFunction",
206
+ "RuntimeFilter",
207
+ "FilterPayload",
208
+ "value_payload",
209
+ "type_payload",
210
+ "artifact_payload",
211
+ "build_filter_batch",
212
+ "serialize_filter_batch",
213
+ "deserialize_filter_batch",
133
214
  "InitRequest",
134
215
  "Level",
135
216
  "VgiOutputCollector",
@@ -138,6 +219,7 @@ __all__ = [
138
219
  "ParameterInfo",
139
220
  "ResolvedMetadata",
140
221
  "RowCountMismatchError",
222
+ "SchemaPath",
141
223
  "ScalarFunction",
142
224
  "ScalarFunctionGenerator",
143
225
  "TableInOutFunction",
@@ -694,7 +694,7 @@ _ACCUMULATE_CATALOG = Catalog(
694
694
  default_schema="main",
695
695
  schemas=[
696
696
  Schema(
697
- name="main",
697
+ path=["main"],
698
698
  comment="Row accumulation keyed by name, persisted via FunctionStorage and scoped per ATTACH",
699
699
  functions=[
700
700
  AccumulateFunction,
@@ -238,7 +238,7 @@ _CATALOG_DESCRIPTOR = Catalog(
238
238
  name=CATALOG_NAME,
239
239
  schemas=[
240
240
  Schema(
241
- name="main",
241
+ path=["main"],
242
242
  tables=(),
243
243
  views=(),
244
244
  functions=(EchoAttachOptionsFunction,),
@@ -49,8 +49,8 @@ class _BogusNullHandling(Enum):
49
49
  class BadEnumCatalog(ExampleCatalog):
50
50
  """ExampleCatalog that advertises a bogus null_handling for one function."""
51
51
 
52
- def _function_to_info(self, func_cls: type, schema_name: str) -> FunctionInfo:
53
- info = super()._function_to_info(func_cls, schema_name)
52
+ def _function_to_info(self, func_cls: type, schema_path: list[str]) -> FunctionInfo:
53
+ info = super()._function_to_info(func_cls, schema_path)
54
54
  if info.name == BAD_ENUM_FUNCTION and info.null_handling is not None:
55
55
  # FunctionInfo is frozen; replace() returns a corrupted copy.
56
56
  return replace(info, null_handling=_BogusNullHandling.WEIRD) # type: ignore[arg-type]