Skip to content

Test fixes for semantic_text#116177

Closed
ioanatia wants to merge 3 commits intoelastic:mainfrom
ioanatia:semantic_text_release_tests_fixes
Closed

Test fixes for semantic_text#116177
ioanatia wants to merge 3 commits intoelastic:mainfrom
ioanatia:semantic_text_release_tests_fixes

Conversation

@ioanatia
Copy link
Copy Markdown
Member

@ioanatia ioanatia commented Nov 4, 2024

Because semantic_text is available only in snapshots some of the tests fail when running with -Dbuild.snapshot=false since I did not add explicit checks for EsqlCapabilities.Cap.SEMANTIC_TEXT.
I assumed that adding semantic_text in UNDER_CONSTRUCTION would take care of that.

Examples of release test failing on a different PR: #114831

To check I have run:

./gradlew ":x-pack:plugin:esql:test" -Dbuild.snapshot=false  -Dbuild.snapshot=false -Dlicense.key=x-pack/license-tools/src/test/resources/public.key

@ioanatia ioanatia added >test Issues or PRs that are addressing/adding tests :Analytics/ES|QL AKA ESQL labels Nov 4, 2024

public Set<DataType> supportedTypes() {
return factories().keySet();
Set<DataType> supportedTypes = new HashSet<>();
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it's either this check here or adding a capabilities check for each function/operator on the evaluators list.
if that's the case we should probably do the same for date_nanos as well.
but I preferred this check than modifying the evaluators list.

@ioanatia ioanatia added the test-release Trigger CI checks against release build label Nov 4, 2024
@ioanatia ioanatia marked this pull request as ready for review November 4, 2024 16:41
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Nov 4, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@ioanatia ioanatia added v9.0.0 v8.17.0 auto-backport Automatically create backport pull requests when merged labels Nov 4, 2024
@ioanatia
Copy link
Copy Markdown
Member Author

ioanatia commented Nov 4, 2024

currently checking a much simpler fix by just removing this check:

public static boolean isString(DataType t) {
if (EsqlCorePlugin.SEMANTIC_TEXT_FEATURE_FLAG.isEnabled() && t == SEMANTIC_TEXT) {
return true;
}
return t == KEYWORD || t == TEXT;
}

and instead just have return t == KEYWORD || t == TEXT || t == SEMANTIC_TEXT;

the type should continue to be unsupported

Copy link
Copy Markdown
Contributor

@craigtaverner craigtaverner left a comment

Choose a reason for hiding this comment

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

I expected this change to mostly impact unit tests, which it seems to have done. I did have a suggestion for the supportedTypes method, which you could consider.

}
supportedTypes.add(dataType);
}
return supportedTypes;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would this be more concise, and perhaps easier to read?

        return EsqlCapabilities.Cap.SEMANTIC_TEXT_TYPE.isEnabled()
            ? factories().keySet()
            : factories().keySet().stream().filter(dataType -> dataType != DataType.SEMANTIC_TEXT).collect(Collectors.toSet());

@ioanatia
Copy link
Copy Markdown
Member Author

ioanatia commented Nov 5, 2024

closing in favour of #116202

@ioanatia ioanatia closed this Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests test-release Trigger CI checks against release build v8.17.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants