flytekit icon indicating copy to clipboard operation
flytekit copied to clipboard

Fix type hint

Open pingsutw opened this issue 1 year ago • 6 comments

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.

pingsutw avatar Jan 19 '24 02:01 pingsutw

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jan 19 '24 02:01 codecov[bot]

What was the error you were seeing?

ringohoffman avatar Jan 19 '24 06:01 ringohoffman

image

pingsutw avatar Jan 19 '24 08:01 pingsutw

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

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

pingsutw avatar Jan 22 '24 18:01 pingsutw

Seems like it got its return type from flyte_entity_call_handler:

https://github.com/flyteorg/flytekit/blob/cba830ea0c9844f8079342ae99a2105b507eca2e/flytekit/core/promise.py#L1132-L1134

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?

ringohoffman avatar Jan 23 '24 04:01 ringohoffman

@ringohoffman here

pingsutw avatar Jan 25 '24 17:01 pingsutw