Skip to content
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

[IO-1464] add in unknown parsing for WFTypes #653

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions darwin/future/data_objects/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ class WFType(Enum):
ARCHIVE = "archive"
CONSENSUS_TEST = "consensus_test"
CONSENSUS_ENTRYPOINT = "consensus_entrypoint"
UNKNOWN = "unknown"

@classmethod
def _missing_(cls, value: str) -> "WFType":
return WFType.UNKNOWN


class WFUser(DefaultDarwin):
Expand Down
5 changes: 5 additions & 0 deletions darwin/future/tests/meta/queries/test_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ def multi_stage_workflow_object(base_single_workflow_object: dict) -> dict:
return base_single_workflow_object


def test_WFTypes_accept_unknonwn() -> None:
assert WFType("unknown") == WFType.UNKNOWN
assert WFType("test") == WFType.UNKNOWN


def test_stage_collects_basic(
filled_query: StageQuery, base_single_workflow_object: dict, base_workflow_meta: WorkflowMeta
) -> None:
Expand Down
Loading