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

Ensure that annotations are dropped in the case of the dataclass and dict type transformers #2318

Merged
merged 7 commits into from
Apr 3, 2024

Conversation

eapolinario
Copy link
Collaborator

@eapolinario eapolinario commented Apr 3, 2024

Tracking issue

NA

Why are the changes needed?

The original exception in the DictTransformer was put in place to catch the case of FlyteAnnotation being set passed to annotated dictionary, e.g. Annotated[dict, FlyteAnnotation("annotation-1")] is invalid. A similar argument applies to the dataclass type transformer.

What changes were proposed in this pull request?

Keep the original exception, but only raise it if the annotation contains a FlyteAnnotation in both the dataclass and the dictionary transformers.

How was this patch tested?

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

…s in general

Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 3, 2024
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Copy link

codecov bot commented Apr 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.02%. Comparing base (55f0b19) to head (ec480bd).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2318      +/-   ##
==========================================
- Coverage   83.50%   76.02%   -7.49%     
==========================================
  Files         324      180     -144     
  Lines       24754    18062    -6692     
  Branches     3734     3527     -207     
==========================================
- Hits        20672    13731    -6941     
- Misses       3452     3733     +281     
+ Partials      630      598      -32     

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

thomasjpfan
thomasjpfan previously approved these changes Apr 3, 2024
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Nit regarding the comment, otherwise LGTM

flytekit/core/type_engine.py Outdated Show resolved Hide resolved
@dosubot dosubot bot added the lgtm This PR has been approved by maintainer label Apr 3, 2024
wild-endeavor
wild-endeavor previously approved these changes Apr 3, 2024
pingsutw
pingsutw previously approved these changes Apr 3, 2024
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 3, 2024
@eapolinario eapolinario changed the title Modify how the DictTransformer handles FlyteAnnotation and annotations in general Ensure that annotations are dropped in the case of the dataclass and dict type transformers Apr 3, 2024
eapolinario and others added 3 commits April 3, 2024 12:37
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
@wild-endeavor wild-endeavor merged commit a240b65 into master Apr 3, 2024
48 of 49 checks passed
ChungYujoyce pushed a commit to ChungYujoyce/flytekit that referenced this pull request Apr 5, 2024
…dict type transformers (flyteorg#2318)

The original exception in the `DictTransformer` was put in place to catch the case of `FlyteAnnotation` being set passed to annotated dictionary, e.g. `Annotated[dict, FlyteAnnotation("annotation-1")]` is invalid. A similar argument applies to the dataclass type transformer.

Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
fiedlerNr9 pushed a commit that referenced this pull request Jul 25, 2024
…dict type transformers (#2318)

The original exception in the `DictTransformer` was put in place to catch the case of `FlyteAnnotation` being set passed to annotated dictionary, e.g. `Annotated[dict, FlyteAnnotation("annotation-1")]` is invalid. A similar argument applies to the dataclass type transformer.

Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Signed-off-by: Jan Fiedler <jan@union.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants