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

Allow struct/dataclass types to be used as default arguments #1024

Merged
merged 4 commits into from
May 27, 2022

Conversation

RobertoRRW
Copy link
Contributor

@RobertoRRW RobertoRRW commented May 26, 2022

Signed-off-by: Roberto Ruiz [email protected]

TL;DR

Pyflyte execution crashes when a task/worflow that takes a dataclass uses a default argument.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

Pyflyte attempts to convert struct type literal arguments for tasks/workflows from json string to its expected type.

I made it so the conversion isn't tried when it isn't necessary.

Tracking Issue

flyteorg/flyte#2555

Follow-up issue

NA

pingsutw
pingsutw previously approved these changes May 27, 2022
Copy link
Member

@pingsutw pingsutw left a comment

Choose a reason for hiding this comment

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

lgtm, thank you for fixing it

@codecov
Copy link

codecov bot commented May 27, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.45%. Comparing base (065b899) to head (a0f4a65).
Report is 1072 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1024      +/-   ##
==========================================
+ Coverage   86.44%   86.45%   +0.01%     
==========================================
  Files         260      261       +1     
  Lines       24618    24640      +22     
  Branches     2780     2782       +2     
==========================================
+ Hits        21281    21303      +22     
  Misses       2862     2862              
  Partials      475      475              

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

Signed-off-by: Eduardo Apolinario <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
@eapolinario eapolinario merged commit 5c1395a into flyteorg:master May 27, 2022
@RobertoRRW RobertoRRW deleted the default-dataclasses branch May 28, 2022 10:01
eapolinario added a commit that referenced this pull request Jun 17, 2022
* Allow struct/dataclass types to be used as default arguments

Signed-off-by: Roberto Ruiz <[email protected]>

* Add test case

Signed-off-by: Eduardo Apolinario <[email protected]>

* Lint

Signed-off-by: Eduardo Apolinario <[email protected]>

Co-authored-by: Eduardo Apolinario <[email protected]>
@eapolinario eapolinario mentioned this pull request Jun 17, 2022
8 tasks
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