Closed imanjra closed 3 months ago
The recent changes introduce enhanced metadata handling and schema management for delegated operations in the FiftyOne codebase. Key updates include adding metadata parameters to various functions, setting and extracting schemas, and modifying unit tests to validate these features. This improves the flexibility and accuracy of operations by allowing detailed schema definitions and metadata to be passed and utilized throughout the execution process.
Files/Modules | Change Summary |
---|---|
fiftyone/factory/repos/delegated_operation.py |
Added outputs_schema parameter to update_run_state and set metadata in queue_operation if provided. |
fiftyone/factory/repos/delegated_operation_doc.py |
Added metadata attribute to DelegatedOperationDoc class, initialized in __init__ and set during object creation from MongoDB document. |
fiftyone/operators/delegated.py |
Added metadata parameter to queue_operation method and included logic to handle output schema in set_completed method. |
fiftyone/operators/executor.py |
Modified execute_or_delegate_operator to handle input schemas and return inputs . Added resolve_type_with_context function for schema resolution. |
fiftyone/operators/server.py |
Removed ExecutionContext from the list of imported entities. |
tests/unittests/delegated_operators_tests.py |
Added MockInputs and MockOutputs classes, modified MockOperator class, and included assertions for metadata in test methods. |
sequenceDiagram
participant User
participant FiftyOneSystem
participant DelegatedOperationQueue
participant Database
User->>FiftyOneSystem: Initiate Operation
FiftyOneSystem->>DelegatedOperationQueue: queue_operation(metadata)
DelegatedOperationQueue->>Database: Store Operation with Metadata
Database-->>DelegatedOperationQueue: Acknowledge Storage
DelegatedOperationQueue->>FiftyOneSystem: Operation Queued
FiftyOneSystem->>DelegatedOperationQueue: set_completed(outputs_schema)
DelegatedOperationQueue->>Database: Update Operation with Output Schema
Database-->>DelegatedOperationQueue: Acknowledge Update
DelegatedOperationQueue->>FiftyOneSystem: Operation Completed
FiftyOneSystem->>User: Notify Completion
In the code where schemas dance,
Metadata now gets its chance.
Inputs, outputs, all aligned,
In operations, clearly defined.
With tests to guide and docs to show,
Our system's smarter, watch it grow!
🐇✨
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?
Teams PR has conflicts. More info here 🙏
This will require a manual merge and conflict resolution. Any objection to ignoring Pull Request / teams (pull_request)
stage for this PR?
This will require a manual merge and conflict resolution. Any objection to ignoring
Pull Request / teams (pull_request)
stage for this PR?
Sure, the check isn't required. But if a bugfix/run-io-schema
branch in Teams is pushed with conflicts resolved it will pass if it is rerun
Trying to avoid things hitting develop
that will have conflicts
What changes are proposed in this pull request?
Store delegated operation IO schema in metadata
How is this patch tested? If it is not, please explain why.
Unit and manual testins
Release Notes
Is this a user-facing change that should be mentioned in the release notes?
(Details in 1-2 sentences. You can just refer to another PR with a description if this PR is part of a larger change.)
What areas of FiftyOne does this PR affect?
fiftyone
Python library changesSummary by CodeRabbit
New Features
Bug Fixes
Tests
Refactor
Chores
ExecutionContext
import to clean up the codebase.