fix: azure ai search write error#702
Closed
mpolomdeepsense wants to merge 5 commits intomainfrom
Closed
Conversation
Drops unknown fields recursively, so that it fully matches defined schema.
Contributor
Author
|
duplicates: #701 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
400 The property 'table_extraction_method' does not exist on type 'search.complex.metadata'because the uploader's field filter only checked top-level keys — sub-fields of complex types passed through unfiltered.get_index_field_names()/ flat-setfilter_doc()withget_index_schema()returning a nested dict and a recursivefilter_doc()that walks complex types and collections of complex objects.Test plan
test_filter_doc_drops_unknown_field_inside_complex_metadataand 11 other new cases cover nested filtering, deep nesting, collections of complex objects, simple-collection passthrough, input non-mutation, and the schema walker against real Azure SDKSimpleField/ComplexField/SearchIndexobjects.AZURE_SEARCH_API_KEY):test_azure_ai_search_destination_drops_unknown_nested_fields— stages real elements, injectsmetadata.table_extraction_methodplus a stray top-level field, runs the uploader against a real index, asserts upload succeeds and document count matches.test_azure_ai_search_destination_rejects_unknown_nested_fields_when_unfiltered— bypasses the filter viawrite_dictand asserts Azure raisesWriteErrormentioning bothtable_extraction_methodandsearch.complex.metadata. Pins the upstream Azure contract: if this stops failing, the filter is no longer load-bearing.Note
Medium Risk
Changes core Azure AI Search upload filtering to recurse into complex/nested fields and lists, which could drop data if schema inference is wrong, but is narrowly scoped to pre-upload shaping and covered by new unit/integration tests.
Overview
Fixes Azure AI Search uploads failing on strict complex-type validation by replacing the flat top-level field allowlist with a nested index schema (
get_index_schema) and a recursivefilter_docthat strips unknown sub-fields inside complex objects and collections.Adds unit coverage for schema-walking and nested/list filtering behavior, plus integration regression/contract tests that (1) verify uploads succeed after injecting unsupported nested/top-level fields and (2) confirm Azure rejects the same doc when bypassing filtering. Bumps version to
1.5.1and records the fix inCHANGELOG.md.Reviewed by Cursor Bugbot for commit 49ce02c. Bugbot is set up for automated code reviews on this repo. Configure here.