-
Notifications
You must be signed in to change notification settings - Fork 605
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
add log path field to DO #5467
add log path field to DO #5467
Conversation
WalkthroughThe pull request enhances the logging capabilities within delegated operations by introducing an optional Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Service as DelegatedOperationService
participant Repo as DelegatedOperationRepo
participant Database
Client->>Service: Execute operation (with optional log_path)
Service->>Repo: update_run_state(..., log_path)
alt log_path provided
Repo->>Database: Update run state with log_path
else no log_path
Repo->>Database: Update run state normally
end
Service->>Client: Return operation status
Possibly related PRs
Suggested reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
✨ Finishing Touches
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
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: 0
🧹 Nitpick comments (1)
fiftyone/factory/repos/delegated_operation_doc.py (1)
78-78
: Simplify the dictionary lookup.The second argument
None
indoc.get("log_path", None)
is redundant sinceget()
returnsNone
by default when the key is not found.Apply this diff to simplify the code:
- self.log_path = doc.get("log_path", None) + self.log_path = doc.get("log_path")🧰 Tools
🪛 Ruff (0.8.2)
78-78: Use
doc.get("log_path")
instead ofdoc.get("log_path", None)
Replace
doc.get("log_path", None)
withdoc.get("log_path")
(SIM910)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
fiftyone/factory/repos/delegated_operation.py
(4 hunks)fiftyone/factory/repos/delegated_operation_doc.py
(2 hunks)fiftyone/operators/delegated.py
(12 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
fiftyone/factory/repos/delegated_operation_doc.py
78-78: Use doc.get("log_path")
instead of doc.get("log_path", None)
Replace doc.get("log_path", None)
with doc.get("log_path")
(SIM910)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: test / test-python (ubuntu-latest-m, 3.10)
- GitHub Check: test / test-app
- GitHub Check: e2e / test-e2e
- GitHub Check: lint / eslint
- GitHub Check: build / build
- GitHub Check: build
🔇 Additional comments (11)
fiftyone/factory/repos/delegated_operation_doc.py (1)
60-60
: LGTM!The
log_path
attribute is correctly initialized toNone
in the constructor.fiftyone/factory/repos/delegated_operation.py (2)
47-47
: LGTM!The
log_path
parameter is correctly added to the method signature with appropriate type annotation.
345-347
: LGTM!The logic to update the
log_path
field in the database is correctly implemented with proper null check.fiftyone/operators/delegated.py (8)
87-87
: LGTM!The
log_path
parameter is correctly added to the method signature and well-documented in the docstring.Also applies to: 99-99
113-113
: LGTM!The
log_path
parameter is correctly passed to the repository'supdate_run_state
method.
163-163
: LGTM!The
log_path
parameter is correctly added to the method signature and well-documented in the docstring.Also applies to: 178-178
195-195
: LGTM!The
log_path
parameter is correctly passed to the repository'supdate_run_state
method.
205-205
: LGTM!The
log_path
parameter is correctly added to the method signature and well-documented in the docstring.Also applies to: 220-220
235-235
: LGTM!The
log_path
parameter is correctly passed to the repository'supdate_run_state
method.
461-463
: LGTM!The
log_path
parameter is correctly added to the method signature and well-documented in the docstring.Also applies to: 473-473
481-481
: LGTM!The
log_path
parameter is correctly passed to the repository'supdate_run_state
method.
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.
lgtm! ✍️
Ah just got around to read this PR now since we were in meetings this morning. Overall, LGTM, just a minor comment: we should consider adding a unit test so that the log_path field (and others) can be tested and validated automatically. |
What changes are proposed in this pull request?
Adding a log_path field for DOs for executors that don't use airflow or have a prebuilt UI can provide a path to a cloud bucket allowing users to download logs in the UI.
How is this patch tested? If it is not, please explain why.
Release Notes
Is this a user-facing change that should be mentioned in the release notes?
notes for FiftyOne users.
What areas of FiftyOne does this PR affect?
fiftyone
Python library changesSummary by CodeRabbit