Skip to content

Prevent reserved fields from being registered#819

Merged
feast-ci-bot merged 2 commits into
feast-dev:masterfrom
terryyylim:apply-fs-validation
Jun 23, 2020
Merged

Prevent reserved fields from being registered#819
feast-ci-bot merged 2 commits into
feast-dev:masterfrom
terryyylim:apply-fs-validation

Conversation

@terryyylim
Copy link
Copy Markdown
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

@terryyylim terryyylim requested a review from zhilingc as a code owner June 23, 2020 03:55
@woop woop changed the title Improve validation check when applying Featureset Prevent reserved fields from being registered Jun 23, 2020
@terryyylim
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

/test test-end-to-end-batch

2 similar comments
@terryyylim
Copy link
Copy Markdown
Member Author

/test test-end-to-end-batch

@terryyylim
Copy link
Copy Markdown
Member Author

/test test-end-to-end-batch

@feast-ci-bot
Copy link
Copy Markdown
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

Details 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
Copy Markdown
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