-
Notifications
You must be signed in to change notification settings - Fork 6
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
𖭦 Ability to override stage on enqueue #89
base: main
Are you sure you want to change the base?
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 d3b859d in 29 seconds
More details
- Looked at
421
lines of code in12
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. sdk/harambe/core.py:598
- Draft comment:
Consider handling unexpectedprevious_stage
values more explicitly, perhaps by raising an exception or logging a warning, instead of defaulting to 'detail'. - Reason this comment was not posted:
Confidence changes required:50%
Theget_next_stage
function should handle unexpectedprevious_stage
values more gracefully. Currently, it defaults to 'detail', which might not be the best approach if the input is invalid.
2. sdk/harambe/observer.py:152
- Draft comment:
Ensure that theurls
property inInMemoryObserver
and other observers reflects the updated tuple structure, including thestage
parameter. - Reason this comment was not posted:
Confidence changes required:50%
Theon_queue_url
method inInMemoryObserver
and other observers now includes astage
parameter, but theurls
property inInMemoryObserver
is not updated to reflect this change. This could lead to confusion or errors when accessingurls
.
3. sdk/test/test_pagination.py:48
- Draft comment:
Consider using a validstage
value instead ofNone
to ensure the test is meaningful and aligns with the intended use case. - Reason this comment was not posted:
Confidence changes required:50%
Thetest_stop_pagination_observer_duplicate_url_error
test function usesNone
for thestage
parameter, which might not be the intended use case. It would be better to use a valid stage value to ensure the test is meaningful.
Workflow ID: wflow_I7gSZD95RrXfYaoZ
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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 3177496 in 23 seconds
More details
- Looked at
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_9qjDgXqdS0iTpel7
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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 d677ae5 in 29 seconds
More details
- Looked at
102
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. sdk/test/test_get_next_stage.py:29
- Draft comment:
The expected stage forNone
should belisting
to match theget_previous_stage
function's behavior. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment points out a potential issue with the test case forget_previous_stage
. If the function's intended behavior is indeed to mapNone
tolisting
, then the test case is incorrect. However, without additional context on the intended behavior ofget_previous_stage
, it's difficult to confirm the comment's validity. The comment is about a change made in the diff, specifically the new test case forget_previous_stage
.
I might be missing the intended behavior of theget_previous_stage
function. The comment assumes a specific behavior without providing evidence from the code or documentation.
The comment could be valid if there is documentation or code elsewhere that specifies the expected behavior ofget_previous_stage
. However, without such evidence, the comment remains speculative.
The comment is speculative without strong evidence. It should be deleted unless there is clear documentation or code indicating the expected behavior ofget_previous_stage
.
Workflow ID: wflow_S7Bcw0vV4pLhi9tX
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
|
||
|
||
@pytest.mark.parametrize( | ||
"previous_stage,expected_stage", |
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.
I don't think this should be introduced to harambe. The consumer of the observer should make this choice
""" | ||
context = context or {} | ||
options = options or {} | ||
stage = stage or get_next_stage(self._stage) |
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.
Would recommend leaving the getnextstage outside of harambe (separation of concerns)
@@ -507,19 +510,23 @@ async def run_from_file( | |||
|
|||
tracker = FileDataTracker(domain, stage) | |||
|
|||
prev = "listing" if stage == "detail" else "category" |
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.
I think we should remove this run from file / stage stuff here too
def get_next_stage(previous_stage: Stage | None) -> Stage: | ||
if previous_stage == "parent_category": | ||
return "category" | ||
if previous_stage == "category": | ||
return "listing" | ||
return "detail" | ||
|
||
|
||
def get_previous_stage(stage: Stage | None) -> Stage: |
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.
Ideally api stuff
Closes #APE-345
Important
Add stage override capability to
enqueue()
in Harambe SDK with updated tests and version bump to 0.51.0.stage
parameter toenqueue()
incore.py
for stage override.get_next_stage()
incore.py
to determine the next stage.on_queue_url()
inobserver.py
to acceptstage
parameter.Stage
intypes.py
.test_get_next_stage.py
to testget_next_stage()
.test_e2e.py
,test_pagination.py
, andtest_sdk.py
forstage
parameter.0.51.0
inpyproject.toml
anduv.lock
forharambe-core
andharambe-sdk
.This description was created by for d677ae5. It will automatically update as commits are pushed.