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

Fix type hint #2118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix type hint #2118

wants to merge 1 commit into from

Conversation

pingsutw
Copy link
Member

@pingsutw pingsutw commented Jan 19, 2024

Tracking issue

Before:
image

After:
image

Why are the changes needed?

What changes were proposed in this pull request?

Get warning in IDE

Update type hint.

Signed-off-by: Kevin Su <[email protected]>
Copy link

codecov bot commented Jan 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1127206) 85.26% compared to head (7cc4e81) 85.78%.
Report is 54 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2118      +/-   ##
==========================================
+ Coverage   85.26%   85.78%   +0.52%     
==========================================
  Files         290      313      +23     
  Lines       22334    23512    +1178     
  Branches     3512     3515       +3     
==========================================
+ Hits        19042    20169    +1127     
- Misses       2684     2734      +50     
- Partials      608      609       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ringohoffman
Copy link
Contributor

What was the error you were seeing?

@pingsutw
Copy link
Member Author

image

Copy link
Collaborator

@eapolinario eapolinario left a comment

Choose a reason for hiding this comment

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

We shouldn't do this. This effectively removes typing information from tasks.

@pingsutw
Copy link
Member Author

We shouldn't do this. This effectively removes typing information from tasks.

is there any way to fix it? current typing information is wrong.

@ringohoffman
Copy link
Contributor

Seems like it got its return type from flyte_entity_call_handler:

def flyte_entity_call_handler(
entity: SupportsNodeCreation, *args, **kwargs
) -> Union[Tuple[Promise], Promise, VoidPromise, Tuple, Coroutine, None]:

also there is a type: ignore comment on the return of Task.__call__. Maybe we can start with making sure this signature is as expected.

It seems like you have another workflow called train you are saying returns a str, but Task.__call__ never references the user's declared return type. On which of the paths does it return the result of the underlying function?

@pingsutw
Copy link
Member Author

@ringohoffman here

@pingsutw pingsutw marked this pull request as draft January 30, 2024 10:45
@pingsutw pingsutw self-assigned this Jan 30, 2024
@pingsutw pingsutw marked this pull request as ready for review February 9, 2024 23:49
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants