Skip to content

[FEATURE] Allow CocoIndex Table bind to dict / list in Python #758

@badmonster0

Description

@badmonster0

This is a continuation of #670, which supports binding Struct to dict, so users don't need to explicitly define a dataclass, and can even omit type annotations for Engine->Python value binding (e.g. argument of custom functions)

We also want to support it for Table types, in particular:

  • For LTable, supports binding to list[dict[String, Any]]
  • For KTable, supports binding to dict[K, dict[String, Any]] (K is key type; use a tuple if multiple key parts)
    (it's the runtime type we support, users don't have to annotate)

With this, we'll support omit type annotations for Engine->Python value binding for all data types.


❤️ Contributors, please refer to 📙Contributing Guide.
Unless the PR can be sent immediately (e.g. just a few lines of code), we recommend you to leave a comment on the issue like I'm working on it or Can I work on this issue? to avoid duplicating work. Our Discord server is always open and friendly.

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is neededpython-sdkCocoIndex Python SDK

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions