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

[CDF-21657] Add status filter to workflow executions list #1793

Merged
merged 13 commits into from
Jun 5, 2024

Conversation

VerstraeteBert
Copy link
Contributor

Description

Allows filtering data workflow executions by status

Checklist:

  • Documentation updated. Documentation is generated from docstrings - these must be updated according to your change.
    If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.
  • Changelog updated in CHANGELOG.md.
  • Version bumped. If triggering a new release is desired, bump the version number in _version.py and pyproject.toml per semantic versioning.

@VerstraeteBert VerstraeteBert marked this pull request as ready for review June 3, 2024 12:52
@VerstraeteBert VerstraeteBert requested review from a team as code owners June 3, 2024 12:52
@VerstraeteBert VerstraeteBert requested review from haakonvt and removed request for a team June 3, 2024 12:52
Copy link
Contributor

@silvavelosa silvavelosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a test would be nice 👍 .... otherwise LGTM ✔️

Copy link

codecov bot commented Jun 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.90%. Comparing base (d894006) to head (82b83a9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1793      +/-   ##
==========================================
- Coverage   92.93%   92.90%   -0.04%     
==========================================
  Files         121      121              
  Lines       17691    17696       +5     
==========================================
- Hits        16441    16440       -1     
- Misses       1250     1256       +6     
Files Coverage Δ
cognite/client/_api/workflows.py 90.99% <100.00%> (+0.33%) ⬆️
cognite/client/_version.py 100.00% <100.00%> (ø)
cognite/client/data_classes/workflows.py 95.11% <100.00%> (+0.01%) ⬆️

... and 4 files with indirect coverage changes

@VerstraeteBert VerstraeteBert enabled auto-merge (squash) June 3, 2024 13:51
@VerstraeteBert VerstraeteBert disabled auto-merge June 3, 2024 14:03
@@ -212,6 +212,7 @@ def list(
workflow_version_ids: WorkflowVersionIdentifier | MutableSequence[WorkflowVersionIdentifier] | None = None,
created_time_start: int | None = None,
created_time_end: int | None = None,
statuses: list[Literal["completed", "failed", "running", "terminated", "timed_out"]] | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also allow a single status to be passed in, not just a list? It is a minor thing, but makes the users life a bit easier

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The statuses there are the statuses for Tasks. The naming is a bit unfortunate. Would be a potential breaking change.

@VerstraeteBert VerstraeteBert requested a review from doctrino June 4, 2024 17:00
@VerstraeteBert VerstraeteBert marked this pull request as draft June 4, 2024 17:03
@VerstraeteBert VerstraeteBert marked this pull request as ready for review June 5, 2024 07:46
@@ -32,6 +32,8 @@
"skipped",
]

WorkflowStatus: TypeAlias = Literal["completed", "failed", "running", "terminated", "timed_out"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"paused" has been removed from the possible statuses.
https://github.com/cognitedata/service-contracts/pull/2535

Copy link
Contributor

@doctrino doctrino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice clarification between Task and Workflow status. In addition, to a user friendly input. Good work

@VerstraeteBert VerstraeteBert merged commit a50067b into master Jun 5, 2024
12 checks passed
@VerstraeteBert VerstraeteBert deleted the CDF-21657 branch June 5, 2024 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants