vgi.invocation
Module overview
Response types for the VGI protocol.
This module defines response dataclasses and the FunctionType enum:
FunctionType: Enum for scalar, table, and aggregate function types.BindResponse: Result of bind phase with output schema.BaseInitResponse: Base class for init responses.GlobalInitResponse: Result of init phase with max_workers.
Request types (BindRequest, InitRequest) are in vgi.protocol.
class BaseInitResponse
Section titled âclass BaseInitResponseâBases: ArrowSerializableDataclass
Description
The result of calling init() on a function.
Attributes
attribute execution_id
Section titled âattribute execution_idâbytes
A unique id for the function execution.
attribute opaque_data
Section titled âattribute opaque_dataâAnnotated[bytes | None, ArrowType(pa.binary())]
Serialized data that is opaque to the caller that must be passed to any init() invocations.
class BindResponse
Section titled âclass BindResponseâBases: ArrowSerializableDataclass
Description
The result of calling bind() on a function.
The bind result is created by calling bind() and importantly contains the functionâs output characteristics. It is serialized and sent to the client before any data processing begins.
When lookup_secret_types is non-empty, this is a secret scope
request rather than a normal bind response. C++ resolves the requested
secrets and retries bind with resolved_secrets_provided=True. The
developer never constructs scope requests directly â the framework
generates them when SecretsAccessor has pending lookups after
on_bind() returns.
Attributes
attribute output_schema
Section titled âattribute output_schemaâAnnotated[pa.Schema, ArrowType(pa.binary())]
Arrow schema describing the structure of output batches.
attribute opaque_data
Section titled âattribute opaque_dataâAnnotated[bytes | None, ArrowType(pa.binary())]
Serialized data that is opaque to the caller that must be passed to any init() invocations.
attribute lookup_secret_types
Section titled âattribute lookup_secret_typesâlist[str]
Secret types for scoped lookup requests (empty = normal response).
attribute lookup_scopes
Section titled âattribute lookup_scopesâlist[str]
Scopes for scoped lookup requests (parallel to lookup_secret_types).
attribute lookup_names
Section titled âattribute lookup_namesâlist[str]
Names for scoped lookup requests (parallel to lookup_secret_types).
attribute is_secret_scope_request
Section titled âattribute is_secret_scope_requestâbool
True if this is a secret scope request, not a normal bind response.
Methods
method secret_scope_request
Section titled âmethod secret_scope_requestâsecret_scope_request(entries: list[SecretLookupEntry]) -> BindResponseCreate a secret scope request from lookup entries.
The framework calls this when SecretsAccessor has pending lookups.
C++ detects the non-empty lookup_secret_types and resolves them.
method secret_scope_entries
Section titled âmethod secret_scope_entriesâsecret_scope_entries() -> list[SecretLookupEntry]Convert lookup fields back to SecretLookupEntry objects.
class FunctionType
Section titled âclass FunctionTypeâBases: Enum
Description
Type of function being invoked.
Used in BindRequest to indicate which function category is being bound,
allowing the worker to apply appropriate validation and processing.
Attributes
attribute AGGREGATE
Section titled âattribute AGGREGATEâattribute SCALAR
Section titled âattribute SCALARâattribute TABLE
Section titled âattribute TABLEâattribute TABLE_BUFFERING
Section titled âattribute TABLE_BUFFERINGâclass GlobalInitResponse
Section titled âclass GlobalInitResponseâBases: BaseInitResponse
Description
The result of calling init() on a function.
Attributes
attribute max_workers
Section titled âattribute max_workersâint
The maximum number of worker processes that may be used for this function execution. This allows the function to control parallelism.
Inherited members (2)
execution_idattribute ¡ from BaseInitResponseopaque_dataattribute ¡ from BaseInitResponse