fix: list/set sampling optimization bug in _recursive_datetime_check#118
Open
Jah-yee wants to merge 2 commits intoEverMind-AI:mainfrom
Open
fix: list/set sampling optimization bug in _recursive_datetime_check#118Jah-yee wants to merge 2 commits intoEverMind-AI:mainfrom
Jah-yee wants to merge 2 commits intoEverMind-AI:mainfrom
Conversation
added 2 commits
March 6, 2026 20:47
The original code had a bug in the list/set sampling optimization: - When list elements are BaseModel objects, _recursive_datetime_check modifies them in-place (via __dict__), not returning a new object - This caused 'first_checked is first_item' to always be True - The code incorrectly assumed no conversion was needed, skipping all elements after the first one Fix: - Track converted datetime fields in BaseModel processing - Add '_datetime_converted_fields' marker to detect actual changes - Check the marker for BaseModel items in list/set sampling logic - This ensures all elements in a list are properly processed
- Fix get_keyword_search_results to iterate over all supported memory types - Fix get_vector_search_results to iterate over all supported memory types - Add MILVUS_REPO_MAP for consistent memory type mapping - Skip unsupported types (e.g., profile) with warning logs instead of failing - Handle individual search failures gracefully to continue with other types Fixes issue: Search API only uses memory_types[0], silently ignoring all other types
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.
Good day,
I found and fixed a bug in the
_recursive_datetime_checkmethod inDocumentBase.Bug Description
The original code has a list/set sampling optimization that only checks the first element to decide whether to process the entire collection:
Problem: When list elements are
BaseModelobjects,_recursive_datetime_checkmodifies them in-place (via__dict__), not returning a new object. This causesfirst_checked is first_itemto always beTrue, making the code incorrectly assume no conversion is needed and skipping all elements after the first one.This was confirmed by the test file
tests/test_group_profile_datetime_check.py(see testtest_list_datetime_conversion):topics[0]: Converted ✅topics[1],topics[2]: Not converted ❌Fix
_datetime_converted_fieldsmarker to detect actual changesTesting
test_list_datetime_confirm_conversionverifies this fix感谢你们的奉献,希望能提供帮助。如果我解决得有问题或有待商妥的地方,请在下面留言,我会来处理。
Warmly,
Spark Lab Scout