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

Version default to 1 for get methods and increment for create #50

Merged
merged 4 commits into from
Jul 7, 2020

Conversation

moritzmeister
Copy link
Contributor

No description provided.

Comment on lines 68 to 78
public FeatureGroup getFeatureGroup(String name, Integer version)
throws FeatureStoreException, IOException {
if (Strings.isNullOrEmpty(name) || version == null) {
throw new FeatureStoreException("Both name and version are required");
if (Strings.isNullOrEmpty(name)) {
throw new FeatureStoreException("Name is required");
}
if (version == null) {
LOGGER.info("VersionWarning: No version provided for getting feature group `" + name + "`, defaulting to `" +
DEFAULT_VERSION + "`.");
}
return featureGroupApi.get(this, name, version);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The JVM way of achieve this is to have another method called getFeatureGroup(String name) which the only thing that does is to call getFeatureGroup(name, DEFAULT_VERSION)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, actually it wasn't setting the version to 1, so it was wrong. changed it, pls check if it's better now.
The backend isn't handling null versions for getting entities, but maybe it should?

Comment on lines 109 to 115
if (Strings.isNullOrEmpty(name)) {
throw new FeatureStoreException("Name is required");
}
if (version == null) {
LOGGER.info("VersionWarning: No version provided for getting training dataset `" + name + "`, defaulting to `" +
DEFAULT_VERSION + "`.");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see above

@SirOibaf
Copy link
Contributor

SirOibaf commented Jul 7, 2020

Closes #26

@SirOibaf SirOibaf merged commit bd4bb3d into logicalclocks:master Jul 7, 2020
@SirOibaf SirOibaf deleted the versioning-java branch July 7, 2020 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants