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
[PY-542] Set stage #736
[PY-542] Set stage #736
Conversation
PY-542 Set stage
WIP Acceptance Criteria
|
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.
from darwin.future.exceptions import BadRequest | ||
from darwin.future.meta.objects.base import MetaBase | ||
|
||
|
||
class hasStage(Protocol): |
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 it might be useful (in the future, not in this PR) to have like a protocols.py or interfaces.py file that imports all these objects (core only to avoid circular imports), that way we can build on these protocols
from darwin.future.exceptions import BadRequest | ||
from darwin.future.meta.objects.item import Item | ||
|
||
|
||
class hasStage(Protocol): |
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.
As above comment. Then we won't have to define these seperately. Single source of truth.
Problem
Feature Request to set a 'Workflow Stage' to an Item/ItemQuery object.
Solution
Implement
item.set_stage
on both Item and ItemQuery level.Notes:
stage_or_stage_id
- you can pass either a Stage object OR stage_id str.workflow_id
is optional. If this is called via workflow object then set_stage will infer workflow_id from workflow meta_params. Otherwise, then workflow_id is required.items
. It was calling the list_items API with workflow_id as QueryParam, removed it, and addedworkflow_id
with value of self.id,dataset_ids
in meta_params with value as the 1st dataset stage id (assuming a workflow only has 1 dataset stage).Tested below cases:
Changelog
Ability to Set Workflow Stage for Item/ItemQuery