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

[v1] Remove UNKNOWN AST enum variant #1688

Merged
merged 2 commits into from
Dec 24, 2024
Merged

[v1] Remove UNKNOWN AST enum variant #1688

merged 2 commits into from
Dec 24, 2024

Conversation

alancai98
Copy link
Member

Relevant Issues

Description

  • Removes the UNKNOWN AST enum variant
  • Renumbers enums to start from 0. We can always add back UNKNOWN or some "OTHER" variant in the future.
  • Renames TruthValue.UNK to TruthValue.UNKOWN

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@alancai98 alancai98 self-assigned this Dec 19, 2024
@@ -107,7 +102,7 @@ public static DatetimeField parse(@NotNull String value) {
case "SECOND": return SECOND();
case "TIMEZONE_HOUR": return TIMEZONE_HOUR();
case "TIMEZONE_MINUTE": return TIMEZONE_MINUTE();
default: return UNKNOWN();
default: throw new IllegalArgumentException("No enum constant DatetimeField." + value);
Copy link
Member Author

Choose a reason for hiding this comment

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

(self-review): behavior follows what Kotlin does for its valueOf() method, which throws an IllegalArgumentException if the string value does not match any of the enum variants.

public static final int UNK = 3;
public static final int TRUE = 0;
public static final int FALSE = 1;
public static final int UNKNOWN = 2;
Copy link
Member Author

Choose a reason for hiding this comment

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

(self-review): change of UNK -> UNKNOWN is in reference to this recent PR comment -- #1679 (comment).

Copy link

github-actions bot commented Dec 19, 2024

CROSS-ENGINE-REPORT ❌

BASE (LEGACY-V0.14.8) TARGET (EVAL-E2A5528) +/-
% Passing 89.67% 94.32% 4.65% ✅
Passing 5287 5561 274 ✅
Failing 609 54 -555 ✅
Ignored 0 281 281 🔶
Total Tests 5896 5896 0 ✅

Testing Details

  • Base Commit: v0.14.8
  • Base Engine: LEGACY
  • Target Commit: e2a5528
  • Target Engine: EVAL

Result Details

  • ❌ REGRESSION DETECTED. See Now Failing/Ignored Tests. ❌
  • Passing in both: 2641
  • Failing in both: 17
  • Ignored in both: 0
  • PASSING in BASE but now FAILING in TARGET: 5
  • PASSING in BASE but now IGNORED in TARGET: 108
  • FAILING in BASE but now PASSING in TARGET: 180
  • IGNORED in BASE but now PASSING in TARGET: 0

Now FAILING Tests ❌

The following 5 test(s) were previously PASSING in BASE but are now FAILING in TARGET:

Click here to see
  1. undefinedUnqualifiedVariableWithUndefinedVariableBehaviorMissing, compileOption: PERMISSIVE
  2. undefinedUnqualifiedVariableIsNullExprWithUndefinedVariableBehaviorMissing, compileOption: PERMISSIVE
  3. undefinedUnqualifiedVariableIsMissingExprWithUndefinedVariableBehaviorMissing, compileOption: PERMISSIVE
  4. inPredicateWithTableConstructor, compileOption: PERMISSIVE
  5. notInPredicateWithTableConstructor, compileOption: PERMISSIVE

Now IGNORED Tests ❌

The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact.

Now Passing Tests

180 test(s) were previously failing in BASE (LEGACY-V0.14.8) but now pass in TARGET (EVAL-E2A5528). Before merging, confirm they are intended to pass.

The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact.

CROSS-COMMIT-REPORT ✅

BASE (EVAL-B0403E6) TARGET (EVAL-E2A5528) +/-
% Passing 94.32% 94.32% 0.00% ✅
Passing 5561 5561 0 ✅
Failing 54 54 0 ✅
Ignored 281 281 0 ✅
Total Tests 5896 5896 0 ✅

Testing Details

  • Base Commit: b0403e6
  • Base Engine: EVAL
  • Target Commit: e2a5528
  • Target Engine: EVAL

Result Details

  • Passing in both: 5561
  • Failing in both: 54
  • Ignored in both: 281
  • PASSING in BASE but now FAILING in TARGET: 0
  • PASSING in BASE but now IGNORED in TARGET: 0
  • FAILING in BASE but now PASSING in TARGET: 0
  • IGNORED in BASE but now PASSING in TARGET: 0

@@ -14,13 +14,8 @@
*/
@EqualsAndHashCode(callSuper = false)
public class Scope extends AstEnum {
Copy link
Member

Choose a reason for hiding this comment

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

Where is Scope used in the AST? This might be a holdover from @t vs T which I think shouldn't be "scope" but more like some kind of qualifier boolean on the ExprVar/ExprId or whatever we are calling it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, ExprVarRef is the only place it's used. In a future PR (probably when I update the docs), I'll remove the Scope enum opt for a qualifier boolean.

@alancai98 alancai98 merged commit ea779ee into main Dec 24, 2024
14 checks passed
@alancai98 alancai98 deleted the remove-unknown-enum branch December 24, 2024 21:01
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