Skip to content

feat(lancedb): automatic schema migration and collection_metadata cen…#125

Open
sqhyz55 wants to merge 1 commit intoxorbitsai:mainfrom
sqhyz55:fix/schema_adapter
Open

feat(lancedb): automatic schema migration and collection_metadata cen…#125
sqhyz55 wants to merge 1 commit intoxorbitsai:mainfrom
sqhyz55:fix/schema_adapter

Conversation

@sqhyz55
Copy link
Collaborator

@sqhyz55 sqhyz55 commented Mar 10, 2026

…tralization

  • schema_manager: add _get_sql_default_for_pa_type() to map PyArrow types to LanceDB SQL default expressions
  • Replace _validate_schema_fields with _ensure_schema_fields(): add missing columns to existing tables instead of raising; use add_columns() with type-appropriate defaults
  • _create_table: when table exists and schema given, call _ensure_schema_fields for best-effort schema evolution
  • ensure_chunks_table / ensure_embeddings_table: remove required_fields validation and long docstrings; rely on auto-migration
  • Add ensure_collection_metadata_table(); trim docstrings for main_pointers, prompt_templates, ingestion_runs
  • collection_manager: use ensure_collection_metadata_table(conn) in save path, remove _ensure_metadata_table() and pyarrow import
  • Add tests/core/tools/core/RAG_tools/LanceDB/test_schema_migration.py for default mapping, auto-migration, idempotency, and _ensure_schema_fields.

…tralization

- schema_manager: add _get_sql_default_for_pa_type() to map PyArrow types to
  LanceDB SQL default expressions
- Replace _validate_schema_fields with _ensure_schema_fields(): add missing
  columns to existing tables instead of raising; use add_columns() with
  type-appropriate defaults
- _create_table: when table exists and schema given, call _ensure_schema_fields
  for best-effort schema evolution
- ensure_chunks_table / ensure_embeddings_table: remove required_fields
  validation and long docstrings; rely on auto-migration
- Add ensure_collection_metadata_table(); trim docstrings for main_pointers,
  prompt_templates, ingestion_runs
- collection_manager: use ensure_collection_metadata_table(conn) in save path,
  remove _ensure_metadata_table() and pyarrow import
- Add tests/core/tools/core/RAG_tools/LanceDB/test_schema_migration.py for
  default mapping, auto-migration, idempotency, and _ensure_schema_fields

Migrated from FenixAOS fix/schema_adapter.

Made-with: Cursor
@sqhyz55 sqhyz55 marked this pull request as draft March 11, 2026 06:07
@sqhyz55 sqhyz55 marked this pull request as ready for review March 12, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants