Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions python/cocoindex/op.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
FieldSchema,
)
from .runtime import to_async_call
from .index import IndexOptions


class OpCategory(Enum):
Expand Down Expand Up @@ -430,6 +431,7 @@ class _TargetConnectorContext:
key_decoder: Callable[[Any], Any]
value_fields_schema: list[FieldSchema]
value_decoder: Callable[[Any], Any]
index_options: IndexOptions


def _build_args(
Expand Down Expand Up @@ -543,6 +545,7 @@ def create_export_context(
raw_spec: dict[str, Any],
raw_key_fields_schema: list[Any],
raw_value_fields_schema: list[Any],
raw_index_options: dict[str, Any],
) -> _TargetConnectorContext:
key_annotation, value_annotation = (
(
Expand All @@ -563,6 +566,7 @@ def create_export_context(
)

spec = load_engine_object(self._spec_cls, raw_spec)
index_options = load_engine_object(IndexOptions, raw_index_options)
return _TargetConnectorContext(
target_name=name,
spec=spec,
Expand All @@ -571,6 +575,7 @@ def create_export_context(
key_decoder=key_decoder,
value_fields_schema=value_fields_schema,
value_decoder=value_decoder,
index_options=index_options,
)

def get_persistent_key(self, export_context: _TargetConnectorContext) -> Any:
Expand All @@ -597,6 +602,7 @@ def get_setup_state(self, export_context: _TargetConnectorContext) -> Any:
spec=export_context.spec,
key_fields_schema=export_context.key_fields_schema,
value_fields_schema=export_context.value_fields_schema,
index_options=export_context.index_options,
)
state = get_persistent_state_fn(*args)
if not isinstance(state, self._state_cls):
Expand Down
1 change: 1 addition & 0 deletions src/ops/py_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ impl interface::TargetFactory for PyExportTargetFactory {
pythonize(py, &data_collection.spec)?,
pythonize(py, &data_collection.key_fields_schema)?,
pythonize(py, &data_collection.value_fields_schema)?,
pythonize(py, &data_collection.index_options)?,
),
None,
)
Expand Down
Loading