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

Union/enum handling #2845

Merged
merged 10 commits into from
Oct 22, 2024
Merged

Union/enum handling #2845

merged 10 commits into from
Oct 22, 2024

Conversation

wild-endeavor
Copy link
Contributor

@wild-endeavor wild-endeavor commented Oct 21, 2024

Why are the changes needed?

The union transformer should not be calling out to the super's invocation of assert_type, it should be calling the assert on the underlying subtype's transformer.

What changes were proposed in this pull request?

Fetch each subtype's transformer in the Union transformer and call assert type.

  • Also fixed an issue in the dataclass transformer where a KeyError was being raised instead of a type transformer exception.

How was this patch tested?

Local unit testing, ran workflow on local cluster, tested with flyte remote from jupyter.

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

Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
@wild-endeavor wild-endeavor changed the title Union enum handling Union/enum handling Oct 21, 2024
Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
@eapolinario eapolinario merged commit d2f8b32 into master Oct 22, 2024
104 checks passed
granthamtaylor added a commit that referenced this pull request Oct 22, 2024
* Catch mistake in structured dataset (#2834)

Signed-off-by: Yee Hing Tong <[email protected]>

* Small change to clean up unit test. (#2835)

* delete=true

Signed-off-by: Yee Hing Tong <[email protected]>

* close but don't delete on close

Signed-off-by: Yee Hing Tong <[email protected]>

* skip for 3.9

Signed-off-by: Yee Hing Tong <[email protected]>

* 10

Signed-off-by: Yee Hing Tong <[email protected]>

---------

Signed-off-by: Yee Hing Tong <[email protected]>

* Fix tree printing (#2837)

Signed-off-by: Yee Hing Tong <[email protected]>

* handle case where error may not have args (#2831)

Signed-off-by: Blake Jackson <[email protected]>
Co-authored-by: Blake Jackson <[email protected]>

* Bump pyspark from 3.3.1 to 3.3.2 in /plugins/flytekit-greatexpectations (#2818)

Bumps [pyspark](https://github.com/apache/spark) from 3.3.1 to 3.3.2.
- [Commits](apache/spark@v3.3.1...v3.3.2)

---
updated-dependencies:
- dependency-name: pyspark
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Pull secrets from environment when running locally (#2800)

Signed-off-by: Thomas J. Fan <[email protected]>

* Support executing launchplans from CLI (#2839)

Signed-off-by: Ketan Umare <[email protected]>
Co-authored-by: Ketan Umare <[email protected]>

* Add top-level access to FlyteRemote, FlyteFile, and FlyteDirectory and convenience class methods for FlyteRemote (#2836)

* Config for_endpoint doesn't respect config file (#2843)

Signed-off-by: Yee Hing Tong <[email protected]>

* Union/enum handling (#2845)

* temp

Signed-off-by: Yee Hing Tong <[email protected]>

* delete test

Signed-off-by: Yee Hing Tong <[email protected]>

* allow strings

Signed-off-by: Yee Hing Tong <[email protected]>

* remove enum transformer change and tests

Signed-off-by: Yee Hing Tong <[email protected]>

* reset a test

Signed-off-by: Yee Hing Tong <[email protected]>

* lint

Signed-off-by: Yee Hing Tong <[email protected]>

* use .value for enums to handle dynamic case

Signed-off-by: Yee Hing Tong <[email protected]>

* use prior logic for 3.9

Signed-off-by: Yee Hing Tong <[email protected]>

* add 3.9 testing

Signed-off-by: Yee Hing Tong <[email protected]>

* should always be a union type

Signed-off-by: Yee Hing Tong <[email protected]>

---------

Signed-off-by: Yee Hing Tong <[email protected]>

* update docs for FlyteRemote (#2847)

---------

Signed-off-by: Yee Hing Tong <[email protected]>
Signed-off-by: Blake Jackson <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Ketan Umare <[email protected]>
Co-authored-by: Yee Hing Tong <[email protected]>
Co-authored-by: Blake Jackson <[email protected]>
Co-authored-by: Blake Jackson <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Thomas J. Fan <[email protected]>
Co-authored-by: Ketan Umare <[email protected]>
Co-authored-by: Ketan Umare <[email protected]>
wild-endeavor added a commit that referenced this pull request Oct 22, 2024
* temp

Signed-off-by: Yee Hing Tong <[email protected]>

* delete test

Signed-off-by: Yee Hing Tong <[email protected]>

* allow strings

Signed-off-by: Yee Hing Tong <[email protected]>

* remove enum transformer change and tests

Signed-off-by: Yee Hing Tong <[email protected]>

* reset a test

Signed-off-by: Yee Hing Tong <[email protected]>

* lint

Signed-off-by: Yee Hing Tong <[email protected]>

* use .value for enums to handle dynamic case

Signed-off-by: Yee Hing Tong <[email protected]>

* use prior logic for 3.9

Signed-off-by: Yee Hing Tong <[email protected]>

* add 3.9 testing

Signed-off-by: Yee Hing Tong <[email protected]>

* should always be a union type

Signed-off-by: Yee Hing Tong <[email protected]>

---------

Signed-off-by: Yee Hing Tong <[email protected]>
wild-endeavor added a commit that referenced this pull request Oct 22, 2024
backport of #2845
Signed-off-by: Yee Hing Tong <[email protected]>
kumare3 pushed a commit that referenced this pull request Nov 8, 2024
* temp

Signed-off-by: Yee Hing Tong <[email protected]>

* delete test

Signed-off-by: Yee Hing Tong <[email protected]>

* allow strings

Signed-off-by: Yee Hing Tong <[email protected]>

* remove enum transformer change and tests

Signed-off-by: Yee Hing Tong <[email protected]>

* reset a test

Signed-off-by: Yee Hing Tong <[email protected]>

* lint

Signed-off-by: Yee Hing Tong <[email protected]>

* use .value for enums to handle dynamic case

Signed-off-by: Yee Hing Tong <[email protected]>

* use prior logic for 3.9

Signed-off-by: Yee Hing Tong <[email protected]>

* add 3.9 testing

Signed-off-by: Yee Hing Tong <[email protected]>

* should always be a union type

Signed-off-by: Yee Hing Tong <[email protected]>

---------

Signed-off-by: Yee Hing Tong <[email protected]>
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