-
Notifications
You must be signed in to change notification settings - Fork 686
Fix recursive parsing of embedded document field kwargs #6609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request normalizes embedded document field definitions and adjusts an embedded-list field string representation. It adds a helper Sequence Diagram(s)mermaid mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–25 minutes
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)tests/unittests/dataset_tests.py (2)
🪛 Pylint (4.0.3)tests/unittests/dataset_tests.py[convention] 6969-6969: Missing function or method docstring (C0116) [convention] 6969-6969: Method name "test_dynamic_embedded_list_fields" doesn't conform to 'a-z_$' pattern (C0103) 🪛 Ruff (0.14.5)tests/unittests/dataset_tests.py6998-6998: Use a regular Replace (PT009) 6999-6999: Use a regular Replace (PT009) 7000-7000: Use a regular Replace (PT009) 7001-7001: Use a regular Replace (PT009) 7002-7002: Use a regular Replace (PT009) 7003-7003: Use a regular Replace (PT009) 7004-7004: Use a regular Replace (PT009) 7005-7005: Use a regular Replace (PT009) 7006-7006: Use a regular Replace (PT009) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (1)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
fiftyone/core/fields.py(1 hunks)fiftyone/core/odm/utils.py(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
fiftyone/core/odm/utils.py (1)
fiftyone/core/fields.py (1)
EmbeddedDocumentField(1775-2100)
🪛 Ruff (0.14.5)
fiftyone/core/odm/utils.py
534-534: Missing return type annotation for private function _init_embedded_doc_fields
Add return type annotation: None
(ANN202)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: modified-files
- GitHub Check: build
🔇 Additional comments (2)
fiftyone/core/fields.py (1)
2133-2138: LGTM - Improved string representation clarity.The change correctly displays the embedded document type class name instead of the field class name, making the string output more informative. Since
EmbeddedDocumentListFieldalways wraps anEmbeddedDocumentFieldthat has adocument_typeattribute, this access is safe.fiftyone/core/odm/utils.py (1)
514-517: LGTM - Core fix for recursive embedded document parsing.This correctly initializes
field["fields"]from list to dict before storing infields_dict. This ensures that when line 531 recursively calls_merge_embedded_doc_fields(efield["fields"], field["fields"]), the first argument is a dict as expected, enabling proper handling of 2+ level nested embedded documents.
|
How difficult would it be to turn the test script in the PR description into an automated test that would protect against someone breaking this fix? |
done: 2e3dad4 |
Release Notes
foo.get_implied_field_kwargs()when parsing embedded documents with >=2 levels of nestingTested by
Summary by CodeRabbit
Improvements
Tests
✏️ Tip: You can customize this high-level summary in your review settings.