Skip to content

test(python): add nested field regression matrix tests#3518

Merged
wjones127 merged 2 commits into
lancedb:mainfrom
nuthalapativarun:test/3406-nested-field-regression-matrix
Jun 11, 2026
Merged

test(python): add nested field regression matrix tests#3518
wjones127 merged 2 commits into
lancedb:mainfrom
nuthalapativarun:test/3406-nested-field-regression-matrix

Conversation

@nuthalapativarun

Copy link
Copy Markdown
Contributor

Summary

Closes #3406

Add a regression matrix in python/python/tests/test_nested_fields.py that exercises the full nested field index lifecycle for both the sync and async Python table APIs. The tests will fail if any implementation regresses to leaf-only field names in list_indices, index_stats, search, or filter results.

Test scenarios covered

Index types: BTree scalar, IvfPq vector, FTS

Field-name edge cases (per acceptance criteria):

  • rowId — camelCase top-level field
  • `row-id` — hyphenated top-level field (escaped)
  • parent.`leaf.name` — struct leaf whose name contains a literal dot
  • MetaData.userId — mixed-case nested path
  • `meta-data`.`user-id` — hyphenated struct with hyphenated leaf

Lifecycle operations per index type:

  • create_index / create_scalar_index / create_fts_index
  • list_indices → verify canonical full dotted path (not leaf name)
  • index_stats → verify row count and index type
  • Filtered scan (WHERE nested.field = value)
  • Vector search via nested embedding column
  • FTS search via nested text column
  • add (append) then re-check index listing
  • optimize then re-check index listing

Both sync and async APIs are covered in parallel test classes.

Notes

Lance forbids top-level field names that contain a literal ., so the `a.b` acceptance-criterion variant is exercised as a struct leaf field (parent.`leaf.name``) rather than a top-level column.

Add a regression matrix covering the nested field index lifecycle for
both sync and async Python table APIs.  Tests verify that list_indices,
index_stats, search, filter, append, and optimize all use canonical full
dotted field paths rather than leaf-only names.

Field-name edge cases covered:
  - rowId (camelCase top-level)
  - `row-id` (hyphenated top-level, escaped)
  - parent.`leaf.name` (struct leaf with a literal dot in its name)
  - MetaData.userId (mixed-case nested path)
  - `meta-data`.`user-id` (hyphenated struct + hyphenated leaf)

Index types covered: BTree scalar, IvfPq vector, FTS.
@github-actions github-actions Bot added Python Python SDK chore Small non-consequential change. Hidden from changelogs. labels Jun 9, 2026

@wjones127 wjones127 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I have a suggestion for an additional test case, but if it's turns out to be failing or too complex, happy to defer to a follow up.

Comment thread python/python/tests/test_nested_fields.py
@wjones127
wjones127 merged commit 04480c2 into lancedb:main Jun 11, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Small non-consequential change. Hidden from changelogs. Python Python SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cross-binding nested field regression matrix

2 participants