-
Notifications
You must be signed in to change notification settings - Fork 592
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
make ctx.view saved view aware for python operators #4200
Conversation
WalkthroughThe recent updates focus on enhancing functionality related to the handling of view contexts within an application. Specifically, the changes introduce and utilize a Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4200 +/- ##
=========================================
Coverage 28.84% 28.85%
=========================================
Files 768 769 +1
Lines 97035 97141 +106
Branches 1120 1128 +8
=========================================
+ Hits 27991 28026 +35
- Misses 69044 69115 +71
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (4)
- app/packages/operators/src/hooks.ts (3 hunks)
- app/packages/operators/src/operators.ts (5 hunks)
- app/packages/operators/src/state.ts (5 hunks)
- fiftyone/operators/executor.py (3 hunks)
Additional comments: 9
app/packages/operators/src/hooks.ts (1)
- 31-31: The addition of
viewName
to theuseOperatorThrottledContextSetter
function is correctly implemented. It's properly retrieved usinguseRecoilValue
and included in both the context object and the dependency array ofuseEffect
. This ensures that the context accurately reflects the current state, including the saved view name, aligning with the PR's objectives.Also applies to: 57-57, 68-68
app/packages/operators/src/state.ts (2)
- 86-86: The addition of
viewName
to theglobalContextSelector
is correctly implemented. It's properly retrieved usingget(fos.viewName)
and included in the returned context object. This ensures that the global context accurately reflects the current state, including the saved view name, aligning with the PR's objectives.Also applies to: 96-96
- 126-126: The addition of
viewName
to theuseExecutionContext
function is correctly implemented. It's properly included in the execution context passed to operators, ensuring that operators can interact intelligently with saved views. This aligns with the PR's objectives and enhances the application's functionality.Also applies to: 139-139, 152-153
app/packages/operators/src/operators.ts (5)
- 446-446: The addition of
view_name
to the request payload in theexecuteOperatorAsGenerator
function is correctly implemented. It ensures that the server-side execution of operators can consider the saved view name, aligning with the PR's objectives and enhancing the application's functionality.- 546-546: The addition of
view_name
to the request payload in theexecuteOperatorWithContext
function is correctly implemented. It ensures that the execution context passed to operators includes the saved view name, aligning with the PR's objectives and enhancing the application's functionality.- 613-613: The addition of
view_name
to the request payload in theresolveRemoteType
function is correctly implemented. It ensures that the type resolution process can consider the saved view name, aligning with the PR's objectives and enhancing the application's functionality.- 681-681: The addition of
view_name
to the request payload in theresolveExecutionOptions
function is correctly implemented. It ensures that the execution options resolution process can consider the saved view name, aligning with the PR's objectives and enhancing the application's functionality.- 710-710: The addition of
view_name
to the request payload in thefetchRemotePlacements
function is correctly implemented. It ensures that the remote placements fetching process can consider the saved view name, aligning with the PR's objectives and enhancing the application's functionality.fiftyone/operators/executor.py (1)
- 507-524: The implementation for resolving the view based on
view_name
or other parameters is clear and seems correct. However, it's important to ensure that theview_name
is sanitized and validated before it's used to load a saved view to prevent potential security issues, such as injection attacks or unauthorized access to views.Ensure that
view_name
is properly sanitized and validated before use. If this is handled upstream, please confirm.
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.
worked in resolve_input()
, execute()
, and resolve_output()
for me.
What changes are proposed in this pull request?
make ctx.view saved view aware for python operators
How is this patch tested? If it is not, please explain why.
using an example Python operator that access ctx.view
Release Notes
Is this a user-facing change that should be mentioned in the release notes?
notes for FiftyOne users.
make ctx.view saved view aware for python operators
What areas of FiftyOne does this PR affect?
fiftyone
Python library changesSummary by CodeRabbit
viewName
variable, improving data handling and execution context.view_name
property, refining operations and data fetching.view_name
parameter, ensuring more accurate and efficient data representation.