Skip to content

refactor: add typing for workflow record function #2479

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

BClappe
Copy link
Contributor

@BClappe BClappe commented Jul 28, 2025

No description provided.

@BClappe BClappe requested a review from PProfizi July 28, 2025 08:28
@BClappe BClappe self-assigned this Jul 28, 2025
@BClappe BClappe force-pushed the refactor/typing_workflow_record branch from 3a360d7 to cfc74ac Compare July 28, 2025 08:29
Copy link

codecov bot commented Jul 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.15%. Comparing base (9aaff16) to head (dc613f7).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2479      +/-   ##
==========================================
+ Coverage   84.12%   84.15%   +0.02%     
==========================================
  Files          91       91              
  Lines       10703    10704       +1     
==========================================
+ Hits         9004     9008       +4     
+ Misses       1699     1696       -3     

@PProfizi PProfizi changed the base branch from master to main July 28, 2025 09:15
@BClappe BClappe force-pushed the refactor/typing_workflow_record branch from cfc74ac to 466c945 Compare August 5, 2025 13:59
@BClappe BClappe force-pushed the refactor/typing_workflow_record branch from 62405d0 to 4ab8c8f Compare August 5, 2025 14:00
@@ -624,17 +631,19 @@ def record(self, identifier="", transfer_ownership=True):
return self._api.work_flow_record_instance(self, identifier, transfer_ownership)

@staticmethod
def get_recorded_workflow(id, server=None):
def get_recorded_workflow(id: int, server: AnyServerType | None = None) -> Workflow:
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not think the union with None is mandatory. I think it knows from the default value that the parameter is optional and defaults to None.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From experience, it doesn't always infers this. Maybe it does. Though, type checkers tend to error or warn about that, so I usually specify it may explicitly be None.

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.

2 participants