vgi-python 0.8.4__py3-none-any.whl → 0.8.6__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.
- vgi/_test_fixtures/catalog.py +2 -0
- vgi/_test_fixtures/worker.py +10 -0
- vgi/argument_spec.py +105 -0
- vgi/catalog/catalog_interface.py +28 -1
- vgi/catalog/descriptors.py +20 -1
- vgi/client/catalog_mixin.py +6 -0
- vgi/protocol.py +8 -0
- vgi/worker.py +1 -0
- {vgi_python-0.8.4.dist-info → vgi_python-0.8.6.dist-info}/METADATA +1 -1
- {vgi_python-0.8.4.dist-info → vgi_python-0.8.6.dist-info}/RECORD +13 -13
- {vgi_python-0.8.4.dist-info → vgi_python-0.8.6.dist-info}/WHEEL +0 -0
- {vgi_python-0.8.4.dist-info → vgi_python-0.8.6.dist-info}/entry_points.txt +0 -0
- {vgi_python-0.8.4.dist-info → vgi_python-0.8.6.dist-info}/licenses/LICENSE +0 -0
vgi/_test_fixtures/catalog.py
CHANGED
|
@@ -752,6 +752,7 @@ class InMemoryCatalog(CatalogInterface):
|
|
|
752
752
|
definition: str,
|
|
753
753
|
on_conflict: OnConflict,
|
|
754
754
|
parameter_default_values: pa.RecordBatch | None = None,
|
|
755
|
+
arguments_schema: pa.Schema | None = None,
|
|
755
756
|
) -> None:
|
|
756
757
|
"""Create a new macro."""
|
|
757
758
|
schema_data = self._get_schema(attach_opaque_data, schema_name)
|
|
@@ -773,6 +774,7 @@ class InMemoryCatalog(CatalogInterface):
|
|
|
773
774
|
definition=definition,
|
|
774
775
|
comment=None,
|
|
775
776
|
tags={},
|
|
777
|
+
arguments_schema=arguments_schema,
|
|
776
778
|
)
|
|
777
779
|
)
|
|
778
780
|
self._increment_version(attach_opaque_data)
|
vgi/_test_fixtures/worker.py
CHANGED
|
@@ -519,6 +519,10 @@ _EXAMPLE_CATALOG = Catalog(
|
|
|
519
519
|
parameters=["x", "y"],
|
|
520
520
|
definition="x * y",
|
|
521
521
|
comment="Multiply two values",
|
|
522
|
+
parameter_docs={
|
|
523
|
+
"x": "First factor",
|
|
524
|
+
"y": "Second factor",
|
|
525
|
+
},
|
|
522
526
|
),
|
|
523
527
|
Macro(
|
|
524
528
|
name="vgi_clamp",
|
|
@@ -530,6 +534,11 @@ _EXAMPLE_CATALOG = Catalog(
|
|
|
530
534
|
),
|
|
531
535
|
definition="GREATEST(lo, LEAST(hi, val))",
|
|
532
536
|
comment="Clamp a value between lo and hi (defaults: 0..100)",
|
|
537
|
+
parameter_docs={
|
|
538
|
+
"val": "Value to clamp",
|
|
539
|
+
"lo": "Lower bound (inclusive)",
|
|
540
|
+
"hi": "Upper bound (inclusive)",
|
|
541
|
+
},
|
|
533
542
|
),
|
|
534
543
|
Macro(
|
|
535
544
|
name="vgi_range_table",
|
|
@@ -537,6 +546,7 @@ _EXAMPLE_CATALOG = Catalog(
|
|
|
537
546
|
parameters=["n"],
|
|
538
547
|
definition="SELECT * FROM range(n)",
|
|
539
548
|
comment="Table macro returning range of values",
|
|
549
|
+
parameter_docs={"n": "Number of rows to generate"},
|
|
540
550
|
),
|
|
541
551
|
],
|
|
542
552
|
),
|
vgi/argument_spec.py
CHANGED
|
@@ -27,6 +27,8 @@ __all__ = [
|
|
|
27
27
|
"ArgumentSpec",
|
|
28
28
|
"argument_specs_to_schema",
|
|
29
29
|
"extract_argument_specs",
|
|
30
|
+
"macro_arguments_schema",
|
|
31
|
+
"macro_parameter_docs_from_schema",
|
|
30
32
|
"schema_to_argument_specs",
|
|
31
33
|
# Metadata constants for parsing schemas
|
|
32
34
|
"VGI_ARG_KEY",
|
|
@@ -38,6 +40,7 @@ __all__ = [
|
|
|
38
40
|
"VGI_VARARGS_TRUE",
|
|
39
41
|
"VGI_CONST_KEY",
|
|
40
42
|
"VGI_CONST_TRUE",
|
|
43
|
+
"VGI_DOC_KEY",
|
|
41
44
|
]
|
|
42
45
|
|
|
43
46
|
# =============================================================================
|
|
@@ -61,6 +64,11 @@ VGI_VARARGS_TRUE = b"true"
|
|
|
61
64
|
VGI_CONST_KEY = b"vgi_const"
|
|
62
65
|
VGI_CONST_TRUE = b"true"
|
|
63
66
|
|
|
67
|
+
# Key carrying the per-argument description (UTF-8 text). Presence-only: the key
|
|
68
|
+
# is omitted entirely when there is no doc (absent = undocumented). The
|
|
69
|
+
# ``vgi_doc_*`` prefix is reserved for future per-argument doc variants.
|
|
70
|
+
VGI_DOC_KEY = b"vgi_doc"
|
|
71
|
+
|
|
64
72
|
|
|
65
73
|
def _argument_spec_sort_key(spec: "ArgumentSpec") -> tuple[int, int | str]:
|
|
66
74
|
"""Sort key: positional first (by index), then named (alphabetically)."""
|
|
@@ -98,6 +106,9 @@ class ArgumentSpec:
|
|
|
98
106
|
is_const: True if this argument is constant-folded ([`ConstParam`][]).
|
|
99
107
|
Constant arguments are scalar values known at planning time,
|
|
100
108
|
rather than columnar data processed at runtime.
|
|
109
|
+
doc: Optional human/agent-facing description of the argument. Surfaced
|
|
110
|
+
through the catalog as the ``vgi_doc`` Arrow field metadata key
|
|
111
|
+
(UTF-8); empty string means undocumented.
|
|
101
112
|
|
|
102
113
|
Note:
|
|
103
114
|
For named arguments, the Python attribute name (``name``) and the SQL
|
|
@@ -119,6 +130,7 @@ class ArgumentSpec:
|
|
|
119
130
|
is_any_type: bool = False
|
|
120
131
|
is_varargs: bool = False
|
|
121
132
|
is_const: bool = False
|
|
133
|
+
doc: str = ""
|
|
122
134
|
|
|
123
135
|
def __repr__(self) -> str:
|
|
124
136
|
"""Return concise repr showing key attributes."""
|
|
@@ -197,6 +209,10 @@ def argument_specs_to_schema(specs: Sequence[ArgumentSpec]) -> pa.Schema:
|
|
|
197
209
|
if spec.is_const:
|
|
198
210
|
metadata[VGI_CONST_KEY] = VGI_CONST_TRUE
|
|
199
211
|
|
|
212
|
+
# Per-argument description (UTF-8; presence-only — omit when empty)
|
|
213
|
+
if spec.doc:
|
|
214
|
+
metadata[VGI_DOC_KEY] = spec.doc.encode("utf-8")
|
|
215
|
+
|
|
200
216
|
# Create field with or without metadata
|
|
201
217
|
field = pa.field(
|
|
202
218
|
spec.name,
|
|
@@ -246,6 +262,10 @@ def schema_to_argument_specs(schema: pa.Schema) -> list[ArgumentSpec]:
|
|
|
246
262
|
# Check const
|
|
247
263
|
is_const = metadata.get(VGI_CONST_KEY) == VGI_CONST_TRUE
|
|
248
264
|
|
|
265
|
+
# Per-argument description (UTF-8; absent = undocumented)
|
|
266
|
+
doc_bytes = metadata.get(VGI_DOC_KEY)
|
|
267
|
+
doc = doc_bytes.decode("utf-8") if doc_bytes else ""
|
|
268
|
+
|
|
249
269
|
specs.append(
|
|
250
270
|
ArgumentSpec(
|
|
251
271
|
name=field.name,
|
|
@@ -255,12 +275,93 @@ def schema_to_argument_specs(schema: pa.Schema) -> list[ArgumentSpec]:
|
|
|
255
275
|
is_any_type=is_any_type,
|
|
256
276
|
is_varargs=is_varargs,
|
|
257
277
|
is_const=is_const,
|
|
278
|
+
doc=doc,
|
|
258
279
|
)
|
|
259
280
|
)
|
|
260
281
|
|
|
261
282
|
return specs
|
|
262
283
|
|
|
263
284
|
|
|
285
|
+
# =============================================================================
|
|
286
|
+
# Macro Argument Schemas
|
|
287
|
+
# =============================================================================
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
def macro_arguments_schema(
|
|
291
|
+
parameters: Sequence[str],
|
|
292
|
+
parameter_default_values: pa.RecordBatch | None = None,
|
|
293
|
+
parameter_docs: dict[str, str] | None = None,
|
|
294
|
+
) -> pa.Schema:
|
|
295
|
+
"""Build a macro ``arguments_schema`` describing macro parameters.
|
|
296
|
+
|
|
297
|
+
Mirrors the function ``arguments_schema`` mechanism: one Arrow field per
|
|
298
|
+
macro parameter, in ``parameters`` order, each nullable. The per-parameter
|
|
299
|
+
description is carried via the same ``vgi_doc`` field-metadata key functions
|
|
300
|
+
use (UTF-8, presence-only — the key is omitted entirely when there is no
|
|
301
|
+
doc). A parameter's field type is the type of its default value when one is
|
|
302
|
+
known (from ``parameter_default_values``), else ``pa.null()``.
|
|
303
|
+
|
|
304
|
+
Args:
|
|
305
|
+
parameters: Ordered list of macro parameter names.
|
|
306
|
+
parameter_default_values: Optional one-row ``RecordBatch`` whose columns
|
|
307
|
+
are parameter names with typed default values; used to infer each
|
|
308
|
+
parameter's field type.
|
|
309
|
+
parameter_docs: Optional mapping of parameter name to description. Empty
|
|
310
|
+
or missing descriptions yield no ``vgi_doc`` metadata on the field.
|
|
311
|
+
|
|
312
|
+
Returns:
|
|
313
|
+
Arrow schema with one nullable field per parameter, in order.
|
|
314
|
+
|
|
315
|
+
"""
|
|
316
|
+
docs = parameter_docs or {}
|
|
317
|
+
|
|
318
|
+
# Map parameter name -> Arrow type from the typed default values, if any.
|
|
319
|
+
default_types: dict[str, pa.DataType] = {}
|
|
320
|
+
if parameter_default_values is not None:
|
|
321
|
+
for default_field in parameter_default_values.schema:
|
|
322
|
+
default_types[default_field.name] = default_field.type
|
|
323
|
+
|
|
324
|
+
fields: list[pa.Field[Any]] = []
|
|
325
|
+
for name in parameters:
|
|
326
|
+
metadata: dict[bytes, bytes] = {}
|
|
327
|
+
doc = docs.get(name, "")
|
|
328
|
+
if doc:
|
|
329
|
+
metadata[VGI_DOC_KEY] = doc.encode("utf-8")
|
|
330
|
+
|
|
331
|
+
field = pa.field(
|
|
332
|
+
name,
|
|
333
|
+
default_types.get(name, pa.null()),
|
|
334
|
+
nullable=True,
|
|
335
|
+
metadata=metadata if metadata else None,
|
|
336
|
+
)
|
|
337
|
+
fields.append(field)
|
|
338
|
+
|
|
339
|
+
return pa.schema(fields)
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
def macro_parameter_docs_from_schema(schema: pa.Schema) -> dict[str, str]:
|
|
343
|
+
"""Extract per-parameter descriptions from a macro ``arguments_schema``.
|
|
344
|
+
|
|
345
|
+
Inverse of [`macro_arguments_schema`][]'s ``vgi_doc`` handling: reads the
|
|
346
|
+
``vgi_doc`` field metadata (UTF-8) for each field. Fields without the key
|
|
347
|
+
(undocumented) are omitted from the result.
|
|
348
|
+
|
|
349
|
+
Args:
|
|
350
|
+
schema: A macro ``arguments_schema`` (one field per parameter).
|
|
351
|
+
|
|
352
|
+
Returns:
|
|
353
|
+
Mapping of parameter name to description, for documented parameters only.
|
|
354
|
+
|
|
355
|
+
"""
|
|
356
|
+
docs: dict[str, str] = {}
|
|
357
|
+
for field in schema:
|
|
358
|
+
metadata = field.metadata or {}
|
|
359
|
+
doc_bytes = metadata.get(VGI_DOC_KEY)
|
|
360
|
+
if doc_bytes:
|
|
361
|
+
docs[field.name] = doc_bytes.decode("utf-8")
|
|
362
|
+
return docs
|
|
363
|
+
|
|
364
|
+
|
|
264
365
|
# =============================================================================
|
|
265
366
|
# Extraction from Function Classes
|
|
266
367
|
# =============================================================================
|
|
@@ -312,6 +413,7 @@ def extract_argument_specs(
|
|
|
312
413
|
is_any_type=param_arg.is_any,
|
|
313
414
|
is_varargs=param_arg.varargs,
|
|
314
415
|
is_const=False,
|
|
416
|
+
doc=param_arg.doc or "",
|
|
315
417
|
)
|
|
316
418
|
)
|
|
317
419
|
|
|
@@ -328,6 +430,7 @@ def extract_argument_specs(
|
|
|
328
430
|
is_any_type=const_arg.is_any,
|
|
329
431
|
is_varargs=const_arg.varargs,
|
|
330
432
|
is_const=True,
|
|
433
|
+
doc=const_arg.doc or "",
|
|
331
434
|
)
|
|
332
435
|
)
|
|
333
436
|
|
|
@@ -392,6 +495,7 @@ def extract_argument_specs(
|
|
|
392
495
|
is_any_type=is_any_type,
|
|
393
496
|
is_varargs=arg_instance.varargs,
|
|
394
497
|
is_const=getattr(arg_instance, "const", False),
|
|
498
|
+
doc=getattr(arg_instance, "doc", "") or "",
|
|
395
499
|
)
|
|
396
500
|
)
|
|
397
501
|
|
|
@@ -466,6 +570,7 @@ def extract_argument_specs(
|
|
|
466
570
|
is_any_type=is_any_type,
|
|
467
571
|
is_varargs=is_varargs,
|
|
468
572
|
is_const=is_const,
|
|
573
|
+
doc=getattr(arg_legacy, "doc", "") or "",
|
|
469
574
|
)
|
|
470
575
|
)
|
|
471
576
|
|
vgi/catalog/catalog_interface.py
CHANGED
|
@@ -435,6 +435,15 @@ class MacroInfo(CatalogSchemaObject, ArrowSerializableDataclass):
|
|
|
435
435
|
names and values are typed defaults. None if no defaults.
|
|
436
436
|
Serialized as IPC bytes over the wire.
|
|
437
437
|
definition: The SQL expression (scalar) or query (table).
|
|
438
|
+
arguments_schema: Optional Arrow schema (serialized as IPC bytes) with one
|
|
439
|
+
nullable field per parameter, in ``parameters`` order. Each field's type
|
|
440
|
+
is the parameter's default value type when known (else null), and the
|
|
441
|
+
``vgi_doc`` field metadata key carries the parameter's description (UTF-8,
|
|
442
|
+
presence-only — omitted when undocumented). Mirrors the per-argument doc
|
|
443
|
+
channel functions expose via ``FunctionInfo.arguments``. None means the
|
|
444
|
+
worker did not supply per-parameter docs (older workers); the extension
|
|
445
|
+
falls back to ``parameters`` for names. Built with
|
|
446
|
+
``vgi.argument_spec.macro_arguments_schema``.
|
|
438
447
|
|
|
439
448
|
"""
|
|
440
449
|
|
|
@@ -442,6 +451,7 @@ class MacroInfo(CatalogSchemaObject, ArrowSerializableDataclass):
|
|
|
442
451
|
parameters: list[str]
|
|
443
452
|
parameter_default_values: Annotated[pa.RecordBatch | None, ArrowType(pa.binary())] = None
|
|
444
453
|
definition: str = ""
|
|
454
|
+
arguments_schema: Annotated[pa.Schema | None, ArrowType(pa.binary())] = None
|
|
445
455
|
|
|
446
456
|
|
|
447
457
|
class FunctionType(Enum):
|
|
@@ -1979,8 +1989,25 @@ class CatalogInterface(ABC):
|
|
|
1979
1989
|
definition: str,
|
|
1980
1990
|
on_conflict: OnConflict,
|
|
1981
1991
|
parameter_default_values: pa.RecordBatch | None = None,
|
|
1992
|
+
arguments_schema: pa.Schema | None = None,
|
|
1982
1993
|
) -> None:
|
|
1983
|
-
"""Create a new macro with the given definition.
|
|
1994
|
+
"""Create a new macro with the given definition.
|
|
1995
|
+
|
|
1996
|
+
Args:
|
|
1997
|
+
attach_opaque_data: Per-attach catalog session token.
|
|
1998
|
+
transaction_opaque_data: Optional transaction handle.
|
|
1999
|
+
schema_name: Schema to create the macro in.
|
|
2000
|
+
name: Name for the new macro.
|
|
2001
|
+
macro_type: Whether this is a scalar or table macro.
|
|
2002
|
+
parameters: Ordered list of parameter names.
|
|
2003
|
+
definition: SQL expression (scalar) or query (table).
|
|
2004
|
+
on_conflict: Behavior if the macro already exists.
|
|
2005
|
+
parameter_default_values: One-row ``RecordBatch`` with typed defaults.
|
|
2006
|
+
arguments_schema: Optional Arrow schema (one nullable field per
|
|
2007
|
+
parameter, in ``parameters`` order) carrying per-parameter
|
|
2008
|
+
descriptions via the ``vgi_doc`` field metadata key. ``None`` when
|
|
2009
|
+
no per-parameter docs are supplied.
|
|
2010
|
+
"""
|
|
1984
2011
|
raise NotImplementedError("Macro create not implemented.")
|
|
1985
2012
|
|
|
1986
2013
|
def macro_drop(
|
vgi/catalog/descriptors.py
CHANGED
|
@@ -18,6 +18,7 @@ from typing import TYPE_CHECKING, Any, Union
|
|
|
18
18
|
|
|
19
19
|
import pyarrow as pa
|
|
20
20
|
|
|
21
|
+
from vgi.argument_spec import macro_arguments_schema
|
|
21
22
|
from vgi.arguments import Arguments
|
|
22
23
|
from vgi.catalog.catalog_interface import (
|
|
23
24
|
AttachOpaqueData,
|
|
@@ -695,6 +696,11 @@ class Macro:
|
|
|
695
696
|
parameter_default_values: One-row `RecordBatch` where columns are parameter
|
|
696
697
|
names and values are typed defaults. None if no defaults.
|
|
697
698
|
Example: pa.RecordBatch.from_pydict({"b": [5]}) for b := 5.
|
|
699
|
+
parameter_docs: Optional mapping of parameter name to a human/agent-facing
|
|
700
|
+
description. Keys must appear in ``parameters``. Descriptions flow over
|
|
701
|
+
the wire via the macro ``arguments_schema``'s ``vgi_doc`` field metadata
|
|
702
|
+
(the same channel functions use), so the DuckDB extension's
|
|
703
|
+
``vgi_function_arguments()`` can surface them. Empty/default = no docs.
|
|
698
704
|
definition: SQL expression (scalar) or query (table).
|
|
699
705
|
comment: Optional macro comment.
|
|
700
706
|
tags: Optional metadata tags.
|
|
@@ -705,12 +711,14 @@ class Macro:
|
|
|
705
711
|
macro_type: MacroType
|
|
706
712
|
parameters: list[str] = field(default_factory=list)
|
|
707
713
|
parameter_default_values: pa.RecordBatch | None = None
|
|
714
|
+
parameter_docs: dict[str, str] = field(default_factory=dict)
|
|
708
715
|
definition: str = ""
|
|
709
716
|
comment: str | None = None
|
|
710
717
|
tags: dict[str, str] = field(default_factory=dict)
|
|
711
718
|
|
|
712
719
|
def __post_init__(self) -> None:
|
|
713
720
|
"""Validate macro configuration."""
|
|
721
|
+
param_set = set(self.parameters)
|
|
714
722
|
if self.parameter_default_values is not None:
|
|
715
723
|
if self.parameter_default_values.num_rows != 1:
|
|
716
724
|
raise ValueError(
|
|
@@ -718,13 +726,19 @@ class Macro:
|
|
|
718
726
|
f"got {self.parameter_default_values.num_rows}"
|
|
719
727
|
)
|
|
720
728
|
# Validate that default param column names exist in parameters list
|
|
721
|
-
param_set = set(self.parameters)
|
|
722
729
|
for col_name in self.parameter_default_values.schema.names:
|
|
723
730
|
if col_name not in param_set:
|
|
724
731
|
raise ValueError(
|
|
725
732
|
f"Macro '{self.name}': default parameter '{col_name}' not found "
|
|
726
733
|
f"in parameters list {self.parameters}"
|
|
727
734
|
)
|
|
735
|
+
# Validate that documented parameter names exist in parameters list
|
|
736
|
+
for doc_name in self.parameter_docs:
|
|
737
|
+
if doc_name not in param_set:
|
|
738
|
+
raise ValueError(
|
|
739
|
+
f"Macro '{self.name}': documented parameter '{doc_name}' not found "
|
|
740
|
+
f"in parameters list {self.parameters}"
|
|
741
|
+
)
|
|
728
742
|
|
|
729
743
|
def to_macro_info(self, schema_name: str) -> MacroInfo:
|
|
730
744
|
"""Convert to [`MacroInfo`][] for catalog response."""
|
|
@@ -737,6 +751,11 @@ class Macro:
|
|
|
737
751
|
definition=self.definition,
|
|
738
752
|
comment=self.comment,
|
|
739
753
|
tags=dict(self.tags),
|
|
754
|
+
arguments_schema=macro_arguments_schema(
|
|
755
|
+
self.parameters,
|
|
756
|
+
self.parameter_default_values,
|
|
757
|
+
self.parameter_docs,
|
|
758
|
+
),
|
|
740
759
|
)
|
|
741
760
|
|
|
742
761
|
|
vgi/client/catalog_mixin.py
CHANGED
|
@@ -1196,6 +1196,7 @@ class CatalogClientMixin:
|
|
|
1196
1196
|
definition: str,
|
|
1197
1197
|
on_conflict: OnConflict = OnConflict.ERROR,
|
|
1198
1198
|
parameter_default_values: pa.RecordBatch | None = None,
|
|
1199
|
+
arguments_schema: pa.Schema | None = None,
|
|
1199
1200
|
) -> None:
|
|
1200
1201
|
"""Create a new macro.
|
|
1201
1202
|
|
|
@@ -1209,6 +1210,10 @@ class CatalogClientMixin:
|
|
|
1209
1210
|
definition: SQL expression (scalar) or query (table).
|
|
1210
1211
|
on_conflict: Behavior if macro already exists.
|
|
1211
1212
|
parameter_default_values: One-row `RecordBatch` with typed defaults.
|
|
1213
|
+
arguments_schema: Optional Arrow schema (one nullable field per
|
|
1214
|
+
parameter, in ``parameters`` order) carrying per-parameter
|
|
1215
|
+
descriptions via the ``vgi_doc`` field metadata key. Build with
|
|
1216
|
+
``vgi.argument_spec.macro_arguments_schema``.
|
|
1212
1217
|
|
|
1213
1218
|
"""
|
|
1214
1219
|
with self._catalog_connect() as proxy:
|
|
@@ -1222,6 +1227,7 @@ class CatalogClientMixin:
|
|
|
1222
1227
|
definition=definition,
|
|
1223
1228
|
on_conflict=on_conflict,
|
|
1224
1229
|
parameter_default_values=parameter_default_values,
|
|
1230
|
+
arguments_schema=arguments_schema,
|
|
1225
1231
|
transaction_opaque_data=transaction_opaque_data,
|
|
1226
1232
|
)
|
|
1227
1233
|
)
|
vgi/protocol.py
CHANGED
|
@@ -562,6 +562,13 @@ class MacroCreateRequest(ArrowSerializableDataclass):
|
|
|
562
562
|
ERROR/IGNORE/REPLACE).
|
|
563
563
|
parameter_default_values: One-row `RecordBatch` where column names are
|
|
564
564
|
parameter names and values are typed defaults; ``None`` if no defaults.
|
|
565
|
+
arguments_schema: Optional Arrow schema (serialized as IPC bytes) with one
|
|
566
|
+
nullable field per parameter, in ``parameters`` order. Each field's type
|
|
567
|
+
is the parameter's default value type when known (else null), and the
|
|
568
|
+
``vgi_doc`` field metadata key carries the parameter's description (UTF-8,
|
|
569
|
+
presence-only — omitted when undocumented). Mirrors the per-argument doc
|
|
570
|
+
channel functions expose. ``None`` when no per-parameter docs are
|
|
571
|
+
supplied. Built with ``vgi.argument_spec.macro_arguments_schema``.
|
|
565
572
|
transaction_opaque_data: Opaque DuckDB transaction handle (bytes); ``None``
|
|
566
573
|
when not inside a transaction.
|
|
567
574
|
"""
|
|
@@ -574,6 +581,7 @@ class MacroCreateRequest(ArrowSerializableDataclass):
|
|
|
574
581
|
definition: str
|
|
575
582
|
on_conflict: OnConflict
|
|
576
583
|
parameter_default_values: Annotated[pa.RecordBatch | None, ArrowType(pa.binary())] = None
|
|
584
|
+
arguments_schema: Annotated[pa.Schema | None, ArrowType(pa.binary())] = None
|
|
577
585
|
transaction_opaque_data: bytes | None = None
|
|
578
586
|
|
|
579
587
|
|
vgi/worker.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vgi-python
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.6
|
|
4
4
|
Summary: Vector Gateway Interface - Connect DuckDB to external programs via Apache Arrow
|
|
5
5
|
Project-URL: Homepage, https://query.farm
|
|
6
6
|
Project-URL: Repository, https://github.com/Query-farm/vgi-python
|
|
@@ -2,7 +2,7 @@ vgi/__init__.py,sha256=PRtFvXxhHEbY_0KVhyXIbGigZDYKHzMS-4gp0p6IJSQ,3414
|
|
|
2
2
|
vgi/_duckdb.py,sha256=YB5D7N3Bwg_xP6X8a5QlumtlAovSej1A1Go5XlNGVko,2162
|
|
3
3
|
vgi/_storage_profile.py,sha256=VkTsXojuE0tHEzurmteQSAiL1vI3CZSgYkL6D_h8GvE,5061
|
|
4
4
|
vgi/aggregate_function.py,sha256=vn9TjQEHxAKJl_xzQOzdj5TY_6LplcZjv06JkQMnUyo,25184
|
|
5
|
-
vgi/argument_spec.py,sha256=
|
|
5
|
+
vgi/argument_spec.py,sha256=i5VTJSVV5L-gqtyqXOJA_foLMRDo36WcMbcCjvnLyL0,21210
|
|
6
6
|
vgi/arguments.py,sha256=02tIMGIR_cRS73u-bsgpFERxhje-rnTokjBgGsm9pQA,67019
|
|
7
7
|
vgi/auth.py,sha256=3HD2zM-Mt0Ie-_HT5RorpND1OusUw2CPROjPNs7rgbo,1478
|
|
8
8
|
vgi/exceptions.py,sha256=oX_sZc9xGWi7Xf8cJQf89fX19i3ocDEj_V_76GINgBQ,7294
|
|
@@ -15,7 +15,7 @@ vgi/logging_config.py,sha256=zQdDuKL-bXwu0n6Pjyqga5SVIyQ25egL2xhV5hbv66k,3100
|
|
|
15
15
|
vgi/meta_worker.py,sha256=kG5USvnV58S7Wj_RR3W_xM0QlRhaN__m1zwCkA95QOo,29546
|
|
16
16
|
vgi/metadata.py,sha256=VTa625ang6lPgocY4voTOJ7IqET4gsKI4DS07Y53LiM,57914
|
|
17
17
|
vgi/otel.py,sha256=JlUDnk2c0UXSo_j1PJdS67Y--t55sXPg054ADuvHANc,15452
|
|
18
|
-
vgi/protocol.py,sha256
|
|
18
|
+
vgi/protocol.py,sha256=-SXv0vIj49wQ3uwwsnnm16yRp-5EweZpKNHwZgtEF5M,116761
|
|
19
19
|
vgi/protocol_version.txt,sha256=WYVJhIUxBN9cNT4vaBoV_HkkdC-aLkaMKa8kjc5FzgM,6
|
|
20
20
|
vgi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
21
|
vgi/scalar_function.py,sha256=lPHidmcAo_AtItsGqU4wPJhWfa0r_vAjfY6ZjyaW2BQ,47888
|
|
@@ -27,13 +27,13 @@ vgi/table_buffering_function.py,sha256=O5TcIdqk8-YViCQCkb8bOevO-zhe3IoyzLgwXDO3C
|
|
|
27
27
|
vgi/table_filter_pushdown.py,sha256=zak3AuXLVw51vXew93i81fRReG1H8yr4XxCfRnnISj4,63961
|
|
28
28
|
vgi/table_function.py,sha256=_Ni1deyPaabnQJDQz9CUL4fXy79r_OVyN6ZuWTZ1lMQ,52215
|
|
29
29
|
vgi/table_in_out_function.py,sha256=Ouv02ubP-XsRdByIR0ZSagi6VbZfQ8G1e5QWpqlLqvY,15508
|
|
30
|
-
vgi/worker.py,sha256=
|
|
30
|
+
vgi/worker.py,sha256=zrAk_ac_SFMLO0pTZajOrYevAYTGr5opkAV_BtF9CT0,195873
|
|
31
31
|
vgi/_test_fixtures/__init__.py,sha256=xQq-QQLk8USQ6TZHsPiPcZldNNUdcJ2gToXMPGzScLI,444
|
|
32
32
|
vgi/_test_fixtures/attach_options.py,sha256=YtNk1krDdKLnNVtX9yGkgS8XyzdOI0oXtNDbAV73Phg,11091
|
|
33
33
|
vgi/_test_fixtures/bad_enum.py,sha256=lIVemVWTM1JVOHut47Q71Czw-sEiMjfFiyZ15NDaWAk,2910
|
|
34
34
|
vgi/_test_fixtures/bad_protocol.py,sha256=L8kxafWZ-4Sd73F6EpCRo1kWVC-09qzof6OYRXazS_8,2495
|
|
35
35
|
vgi/_test_fixtures/cancellable.py,sha256=hetTRLyT4kkazPNcxAdfzj0pYzEmegMksamJbR0w3Ho,12151
|
|
36
|
-
vgi/_test_fixtures/catalog.py,sha256=
|
|
36
|
+
vgi/_test_fixtures/catalog.py,sha256=DuC9r0efwuG-uPdjFFGNMN-Egi2BP9bvDpc1f3uFffM,28106
|
|
37
37
|
vgi/_test_fixtures/http_server.py,sha256=GevITVo61H1Y8K6zWUJj5guB5Y_H6QFfgVtfzRB0EAA,16095
|
|
38
38
|
vgi/_test_fixtures/nest_tensor.py,sha256=UjjW9UwipYG3ehQpZOm4hdzsafMyvVc0ZKJCrqiZTPU,24471
|
|
39
39
|
vgi/_test_fixtures/orchard_catalog.py,sha256=xMknth9FsVs8-y6vQyIZqDfUhJ-susjpMSzOOhaZyxM,1638
|
|
@@ -41,7 +41,7 @@ vgi/_test_fixtures/simple_writable.py,sha256=CGmDBUY8kthauEm8eJN2lV72cJ9_TRxOAQC
|
|
|
41
41
|
vgi/_test_fixtures/table_in_out.py,sha256=7QckA3NJhYAYuSctcwZLul5yOM2V3KWvLuG_33K0B_w,50459
|
|
42
42
|
vgi/_test_fixtures/versioned.py,sha256=Itm-x_Zt9WDwLGT4Dl4VzU5GtFF4HkcaJEqg9ErB8As,5784
|
|
43
43
|
vgi/_test_fixtures/versioned_tables.py,sha256=KRllGGRrwH8JUtqH-tLHT1JL09rKN-EcEYZVeQdbaLs,22112
|
|
44
|
-
vgi/_test_fixtures/worker.py,sha256=
|
|
44
|
+
vgi/_test_fixtures/worker.py,sha256=m7y5C9meuiOR2iXKnpu7prlq8FX_Zx_b4_Y6b9cNN0I,71676
|
|
45
45
|
vgi/_test_fixtures/accumulate/__init__.py,sha256=4hYT8jqRoVHSjV9TB7v0Z1CMJtdLuPaDWSz4J2fvMDs,868
|
|
46
46
|
vgi/_test_fixtures/accumulate/worker.py,sha256=yal9m-GjKNKUdLOLtwkCyFkeHVv_nnpUjh8amwueT48,30163
|
|
47
47
|
vgi/_test_fixtures/aggregate/__init__.py,sha256=tjCVKdCuHlIAZL7uDi-o_q82oMieXsAyoKExesr-7a0,2156
|
|
@@ -98,14 +98,14 @@ vgi/_test_fixtures/writable/worker.py,sha256=nH8KSZqyKv1gqdKn-_OFVh3h02FbyE0NFQ2
|
|
|
98
98
|
vgi/catalog/__init__.py,sha256=SCpeP2TtPfhWhwaqK5qGmmtHCM2z-EL66OoCkyefy7c,2064
|
|
99
99
|
vgi/catalog/_descriptor_spec.py,sha256=iMqId2fSBqlZ9HU6ct5AkYUAxtRGG_MVTLClDC1WPUs,7673
|
|
100
100
|
vgi/catalog/attach_option.py,sha256=nLGxsfAFR_-NqDrw7v18dtkNNNQIYLr3fuhpVw4XhFc,1739
|
|
101
|
-
vgi/catalog/catalog_interface.py,sha256=
|
|
102
|
-
vgi/catalog/descriptors.py,sha256=
|
|
101
|
+
vgi/catalog/catalog_interface.py,sha256=J6eNB-TMIjakKp7wAPKGLubpjM0YwGeUteaYb3PF5dk,121950
|
|
102
|
+
vgi/catalog/descriptors.py,sha256=GrVrFwmyG7GVT4tF3yT7lr-ZcS-qrxFpnFHKw7khTBU,40437
|
|
103
103
|
vgi/catalog/duckdb_statistics.py,sha256=fARQupgq0fD46rDgxDXvdCFsgs-rvCOHhls7WXHmnFY,15615
|
|
104
104
|
vgi/catalog/secret_type.py,sha256=MKtAypBa3xXyr-NC5CHjdX1R00JEnuMtvgboFWC2T9o,3336
|
|
105
105
|
vgi/catalog/setting.py,sha256=06QfgaAR-0BKflIJ0du6PGqA5BPMdrkwr6u7f4nddII,1846
|
|
106
106
|
vgi/catalog/storage.py,sha256=DhngzywbhQUfLF7NjFyiPp4Sw2ovOhcUXAuW3rkBQD8,11935
|
|
107
107
|
vgi/client/__init__.py,sha256=6LPHqlcNFy77apDNXUntgOVLhuXfpJyZd6TI7R7QfbY,2122
|
|
108
|
-
vgi/client/catalog_mixin.py,sha256=
|
|
108
|
+
vgi/client/catalog_mixin.py,sha256=0EL7eY6DYkqIq_zWWjcEH7xCyNkEyxaoygMW0ehsvEY,45908
|
|
109
109
|
vgi/client/cli.py,sha256=KfoqIiMXiUNAdYxRp-O6BOi3FA1IsesSBb_XeZGWFSo,22287
|
|
110
110
|
vgi/client/cli_catalog.py,sha256=twjlhHGl7n2mNN4jc7DnDRQr-Zj9KLAF2eATIQnITHQ,5577
|
|
111
111
|
vgi/client/cli_schema.py,sha256=FTkf1moDn_dWFMPDxJqaNFhc2oyrLEutP8xC60EbPIk,7556
|
|
@@ -122,8 +122,8 @@ vgi/transactor/_duckdb_compat.py,sha256=sXVZ9JLKAQyGR1BjWczSwdQEavtr-TcZPoVZZnTr
|
|
|
122
122
|
vgi/transactor/client.py,sha256=7DTeMksogsw6ANjQjGOPpKYrV76rg4_kGjktMJf54jg,4486
|
|
123
123
|
vgi/transactor/protocol.py,sha256=Mtmll3CdrLFL1B4NY4NZUTO_yi3PT0qhvMQnzapuBWU,4780
|
|
124
124
|
vgi/transactor/server.py,sha256=WpIqjzy2Mebw17Jui4-w7vyGEo9pD-pEZJG-3Ob1Sk8,29705
|
|
125
|
-
vgi_python-0.8.
|
|
126
|
-
vgi_python-0.8.
|
|
127
|
-
vgi_python-0.8.
|
|
128
|
-
vgi_python-0.8.
|
|
129
|
-
vgi_python-0.8.
|
|
125
|
+
vgi_python-0.8.6.dist-info/METADATA,sha256=b59V9U4mHNCh4vgMDP_4iOEGPAa6eCisvaxwNhrtC4s,24725
|
|
126
|
+
vgi_python-0.8.6.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
127
|
+
vgi_python-0.8.6.dist-info/entry_points.txt,sha256=3Kz1vgodw3pOL_xjtSyDB55-ZRy-U2X-X_Bdr582x0Q,165
|
|
128
|
+
vgi_python-0.8.6.dist-info/licenses/LICENSE,sha256=pbJb4zZasP6n5ifEV81wFu017TarjydaYVmGbHcehtY,6103
|
|
129
|
+
vgi_python-0.8.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|