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

Prevent reserved fields from being registered #819

Merged
merged 2 commits into from
Jun 23, 2020

Conversation

terryyylim
Copy link
Member

What this PR does / why we need it:
This PR prevents applying of Featuresets with Feature names that are reserved.

Which issue(s) this PR fixes:

Fixes #818

Does this PR introduce a user-facing change?:

NONE

@woop woop changed the title Improve validation check when applying Featureset Prevent reserved fields from being registered Jun 23, 2020
@terryyylim
Copy link
Member Author

/test test-end-to-end


private static void checkReservedColumns(List<FeatureSpec> featureSpecs) {
List<String> reservedNames =
Arrays.asList("created_timestamp", "event_timestamp", "ingestion_id", "job_id");
Copy link
Member

@woop woop Jun 23, 2020

Choose a reason for hiding this comment

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

These should be defined elsewhere as constants, not within the method. You can at least hoist it to the top of the class as a field.

if (reservedNames.contains(featureSpec.getName())) {
throw new IllegalArgumentException(
String.format(
"Reserved feature names have been used, which are not allowed. These names include %s.",
Copy link
Member

Choose a reason for hiding this comment

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

Please include the field the user tried to register as well.

@terryyylim
Copy link
Member Author

/test test-end-to-end-batch

2 similar comments
@terryyylim
Copy link
Member Author

/test test-end-to-end-batch

@terryyylim
Copy link
Member Author

/test test-end-to-end-batch

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pyalex, terryyylim

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pyalex
Copy link
Collaborator

pyalex commented Jun 23, 2020

/lgtm

@feast-ci-bot feast-ci-bot merged commit a16d7ee into feast-dev:master Jun 23, 2020
@ches ches added the backport-candidate Changes that may be desired for backport to earlier Feast release tracks label Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved backport-candidate Changes that may be desired for backport to earlier Feast release tracks kind/bug lgtm size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature set spec with reserved spec should not be allowed to be registered
5 participants