-
Notifications
You must be signed in to change notification settings - Fork 77
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
Exposes current action name through action context #506
Conversation
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.
👍 Looks good to me! Reviewed everything up to d400926 in 14 seconds
More details
- Looked at
35
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. docs/concepts/actions.rst:113
- Draft comment:
Ensure that the documentation clearly explains how to accessaction_name
fromApplicationContext
, similar to howapp_id
,partition_key
, andsequence_id
are documented. - Reason this comment was not posted:
Confidence changes required:50%
The PR addsaction_name
to theApplicationContext
, but the documentation inactions.rst
andstate-persistence.rst
does not mention how to access it. This should be clarified for consistency and completeness.
2. docs/concepts/state-persistence.rst:46
- Draft comment:
Ensure that the documentation clearly explains how to accessaction_name
fromApplicationContext
, similar to howapp_id
,partition_key
, andsequence_id
are documented. - Reason this comment was not posted:
Confidence changes required:50%
The PR addsaction_name
to theApplicationContext
, but the documentation inactions.rst
andstate-persistence.rst
does not mention how to access it. This should be clarified for consistency and completeness.
Workflow ID: wflow_OksUkwj4FPw9dKve
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
A preview of 929ad84 is uploaded and can be seen here: ✨ https://burr.dagworks.io/pull/506 ✨ Changes may take a few minutes to propagate. Since this is a preview of production, content with |
d400926
to
575ba94
Compare
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.
👍 Looks good to me! Incremental review on 575ba94 in 37 seconds
More details
- Looked at
113
lines of code in5
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. tests/core/test_application.py:1356
- Draft comment:
Consider adding a test case for async context to ensureaction_name
is correctly set and accessible in async scenarios. - Reason this comment was not posted:
Confidence changes required:50%
The PR adds theaction_name
attribute to theApplicationContext
class, which is used in various parts of the codebase. The test cases intest_application.py
andtest_parallelism.py
verify that theaction_name
is correctly set and accessible. However, there is a missing test case for the async context intest_parallelism.py
. Adding a test case for async context would ensure comprehensive coverage.
Workflow ID: wflow_kvP7G7osTAuIxDOO
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
This allows you to get the current action name along with other application-level metadata (sequence ID, partition_key, etc...) See #501 for details
575ba94
to
929ad84
Compare
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.
👍 Looks good to me! Incremental review on 929ad84 in 1 minute and 17 seconds
More details
- Looked at
104
lines of code in5
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. burr/core/application.py:867
- Draft comment:
The check foraction
beingNone
is unnecessary sinceaction
is always provided. Remove theif action else None
condition. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
Looking at the code:
- The
_context_factory
method is called from thecontext
property on line 1922 - The
context
property gets the next action viaget_next_action()
get_next_action()
can return None according to its return type annotation- Therefore
action
CAN be None when passed to_context_factory
- The null check is actually necessary for safety
Am I sure thatget_next_action()
is the only way this method is called? Could there be other callers that guarantee a non-null action?
Looking at the code,_context_factory
is only used in two places: - As a dependency factory value on line 822
- Called directly from the context property on line 1928
In both cases the action comes fromget_next_action()
which can return None.
The comment is incorrect. The null check is necessary becauseaction
can be None when passed to this method since it comes fromget_next_action()
which has an Optional return type.
Workflow ID: wflow_PAyVMP75DYMAZZ2s
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
This allows you to get the current action name along with other application-level metadata (sequence ID, partition_key, etc...)
See #501 for details
Changes
.action_name
to ApplicationContextHow I tested this
Notes
Checklist
Important
Adds
action_name
toApplicationContext
to expose the current action name, with updates to documentation and tests.action_name
attribute toApplicationContext
inapplication.py
to expose the current action name._context_factory()
inapplication.py
to setaction_name
.actions.rst
andstate-persistence.rst
to includeaction_name
in examples of accessing application-level metadata.action_name
intest_application.py
to verify the correct action name is set in the context.test_parallelism.py
to ensureaction_name
is correctly handled in parallel execution contexts.This description was created by for 929ad84. It will automatically update as commits are pushed.