vgi-python 0.8.4__py3-none-any.whl → 0.8.5__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/argument_spec.py CHANGED
@@ -38,6 +38,7 @@ __all__ = [
38
38
  "VGI_VARARGS_TRUE",
39
39
  "VGI_CONST_KEY",
40
40
  "VGI_CONST_TRUE",
41
+ "VGI_DOC_KEY",
41
42
  ]
42
43
 
43
44
  # =============================================================================
@@ -61,6 +62,11 @@ VGI_VARARGS_TRUE = b"true"
61
62
  VGI_CONST_KEY = b"vgi_const"
62
63
  VGI_CONST_TRUE = b"true"
63
64
 
65
+ # Key carrying the per-argument description (UTF-8 text). Presence-only: the key
66
+ # is omitted entirely when there is no doc (absent = undocumented). The
67
+ # ``vgi_doc_*`` prefix is reserved for future per-argument doc variants.
68
+ VGI_DOC_KEY = b"vgi_doc"
69
+
64
70
 
65
71
  def _argument_spec_sort_key(spec: "ArgumentSpec") -> tuple[int, int | str]:
66
72
  """Sort key: positional first (by index), then named (alphabetically)."""
@@ -98,6 +104,9 @@ class ArgumentSpec:
98
104
  is_const: True if this argument is constant-folded ([`ConstParam`][]).
99
105
  Constant arguments are scalar values known at planning time,
100
106
  rather than columnar data processed at runtime.
107
+ doc: Optional human/agent-facing description of the argument. Surfaced
108
+ through the catalog as the ``vgi_doc`` Arrow field metadata key
109
+ (UTF-8); empty string means undocumented.
101
110
 
102
111
  Note:
103
112
  For named arguments, the Python attribute name (``name``) and the SQL
@@ -119,6 +128,7 @@ class ArgumentSpec:
119
128
  is_any_type: bool = False
120
129
  is_varargs: bool = False
121
130
  is_const: bool = False
131
+ doc: str = ""
122
132
 
123
133
  def __repr__(self) -> str:
124
134
  """Return concise repr showing key attributes."""
@@ -197,6 +207,10 @@ def argument_specs_to_schema(specs: Sequence[ArgumentSpec]) -> pa.Schema:
197
207
  if spec.is_const:
198
208
  metadata[VGI_CONST_KEY] = VGI_CONST_TRUE
199
209
 
210
+ # Per-argument description (UTF-8; presence-only — omit when empty)
211
+ if spec.doc:
212
+ metadata[VGI_DOC_KEY] = spec.doc.encode("utf-8")
213
+
200
214
  # Create field with or without metadata
201
215
  field = pa.field(
202
216
  spec.name,
@@ -246,6 +260,10 @@ def schema_to_argument_specs(schema: pa.Schema) -> list[ArgumentSpec]:
246
260
  # Check const
247
261
  is_const = metadata.get(VGI_CONST_KEY) == VGI_CONST_TRUE
248
262
 
263
+ # Per-argument description (UTF-8; absent = undocumented)
264
+ doc_bytes = metadata.get(VGI_DOC_KEY)
265
+ doc = doc_bytes.decode("utf-8") if doc_bytes else ""
266
+
249
267
  specs.append(
250
268
  ArgumentSpec(
251
269
  name=field.name,
@@ -255,6 +273,7 @@ def schema_to_argument_specs(schema: pa.Schema) -> list[ArgumentSpec]:
255
273
  is_any_type=is_any_type,
256
274
  is_varargs=is_varargs,
257
275
  is_const=is_const,
276
+ doc=doc,
258
277
  )
259
278
  )
260
279
 
@@ -312,6 +331,7 @@ def extract_argument_specs(
312
331
  is_any_type=param_arg.is_any,
313
332
  is_varargs=param_arg.varargs,
314
333
  is_const=False,
334
+ doc=param_arg.doc or "",
315
335
  )
316
336
  )
317
337
 
@@ -328,6 +348,7 @@ def extract_argument_specs(
328
348
  is_any_type=const_arg.is_any,
329
349
  is_varargs=const_arg.varargs,
330
350
  is_const=True,
351
+ doc=const_arg.doc or "",
331
352
  )
332
353
  )
333
354
 
@@ -392,6 +413,7 @@ def extract_argument_specs(
392
413
  is_any_type=is_any_type,
393
414
  is_varargs=arg_instance.varargs,
394
415
  is_const=getattr(arg_instance, "const", False),
416
+ doc=getattr(arg_instance, "doc", "") or "",
395
417
  )
396
418
  )
397
419
 
@@ -466,6 +488,7 @@ def extract_argument_specs(
466
488
  is_any_type=is_any_type,
467
489
  is_varargs=is_varargs,
468
490
  is_const=is_const,
491
+ doc=getattr(arg_legacy, "doc", "") or "",
469
492
  )
470
493
  )
471
494
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vgi-python
3
- Version: 0.8.4
3
+ Version: 0.8.5
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=fVO17BDDfjnTMUrRoILNr2oFLTl4KKedMObFUk2GRrI,17072
5
+ vgi/argument_spec.py,sha256=FFtCNVXhUnEvft51HICOVA7jGJilDW0CHYeyuYexGsg,18142
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
@@ -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.4.dist-info/METADATA,sha256=AiJ8ZL_UJ96RP297iwcuoQsUlafMdGR1yr216r8apjA,24725
126
- vgi_python-0.8.4.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
127
- vgi_python-0.8.4.dist-info/entry_points.txt,sha256=3Kz1vgodw3pOL_xjtSyDB55-ZRy-U2X-X_Bdr582x0Q,165
128
- vgi_python-0.8.4.dist-info/licenses/LICENSE,sha256=pbJb4zZasP6n5ifEV81wFu017TarjydaYVmGbHcehtY,6103
129
- vgi_python-0.8.4.dist-info/RECORD,,
125
+ vgi_python-0.8.5.dist-info/METADATA,sha256=1dqjWdLcM1MrxAIF8CVYkGA8YCaZF3T5pamDdUYdIj0,24725
126
+ vgi_python-0.8.5.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
127
+ vgi_python-0.8.5.dist-info/entry_points.txt,sha256=3Kz1vgodw3pOL_xjtSyDB55-ZRy-U2X-X_Bdr582x0Q,165
128
+ vgi_python-0.8.5.dist-info/licenses/LICENSE,sha256=pbJb4zZasP6n5ifEV81wFu017TarjydaYVmGbHcehtY,6103
129
+ vgi_python-0.8.5.dist-info/RECORD,,