Closed brimoor closed 4 days ago
The changes in this pull request focus on the DelegatedOperationRepo
and its subclass MongoDelegatedOperationRepo
within the fiftyone
library. Key modifications include the initialization of the metadata
attribute in the queue_operation
method, which now defaults to an empty dictionary. The update_run_state
method has been simplified by removing unnecessary logic and enhancing error handling. Additionally, unit tests have been updated to reflect these changes, ensuring that the tests now expect an empty dictionary for the metadata
attribute instead of None
.
File Path | Change Summary |
---|---|
fiftyone/factory/repos/delegated_operation.py | - Updated queue_operation to initialize metadata to an empty dictionary.- Simplified update_run_state by removing needs_pipeline_update logic. Enhanced error handling for dataset_id . |
tests/unittests/operators/delegated_tests.py | - Updated assertions in tests to check for an empty dictionary {} for metadata instead of None .- Removed test_output_schema_null_metadata method. |
update_run_state
and queue_operation
methods, indicating a direct relationship in handling metadata
.required_state
parameter to the update_run_state
method, relevant to changes in the main PR.update_run_state
method, suggesting a connection to the main PR's modifications.execute_queued_operations
method, related to changes in the queue_operation
method.🐇 In the code we hop and play,
Metadata's here to stay!
With tests that check and logic bright,
Our functions now feel just right.
So let’s rejoice, both day and night! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
On
develop
, running a delegated operation with an output schema like this one would fail on MongoDB <5 with the following error:The reason was because line 337 was attempting an update aggregation like this:
and sadly this part:
is not supported on MongoDB < 5.
The solution is to ensure that the
metadata
key always exists. Then we don't need theneeds_pipeline_update
flag! 🎉Summary by CodeRabbit
New Features
Bug Fixes
Tests