Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Compiler Enum Support and updated flyteidl #minor #276

Merged
merged 4 commits into from
Jun 12, 2021

Conversation

kumare3
Copy link
Contributor

@kumare3 kumare3 commented Jun 11, 2021

TL;DR

Support for ENUM types in flytecompiler and flytepropeller update to support it

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

https://docs.google.com/document/d/1rf0hMKbPebJ7jGYpsTDAbJ4ka58KIKD7EgWAEBIH06Q/edit#

Tracking Issue

flyteorg/flyte#590

Follow-up issue

NA

kumare3 added 3 commits June 9, 2021 21:20
Signed-off-by: Ketan Umare <[email protected]>
Signed-off-by: Ketan Umare <[email protected]>
Signed-off-by: Ketan Umare <[email protected]>
@kumare3 kumare3 requested a review from EngHabu as a code owner June 11, 2021 23:48
return true
}
}
// If t is an enum, it can be created from a string as Enums as just constrained String aliases
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a runtime error then if the string isn't a valid enum value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but our entry points will not allow bad values

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@katrogan thats actually a good point. Can we restrict this in flyteadmin? Where we construct the launchplan?

Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't the launch plan have to reference the enum type to be valid?

@codecov
Copy link

codecov bot commented Jun 12, 2021

Codecov Report

Merging #276 (e625ae7) into master (ce101c2) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@ -33,6 +33,20 @@ func (t trivialChecker) CastsFrom(upstreamType *flyte.LiteralType) bool {
if isVoid(upstreamType) {
return true
}

// If upstream is an enum, it can be consumed as a string downstream
if upstreamType.GetEnumType() != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should also add a check to the static binding to fail if the string isn't in the list...

@kumare3 kumare3 merged commit dc71485 into master Jun 12, 2021
eapolinario pushed a commit to eapolinario/flytepropeller that referenced this pull request Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants