-
Notifications
You must be signed in to change notification settings - Fork 44
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
Conversation
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); | ||
} |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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?
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 + "`."); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
java/src/main/java/com/logicalclocks/hsfs/engine/TrainingDatasetEngine.java
Outdated
Show resolved
Hide resolved
java/src/main/java/com/logicalclocks/hsfs/engine/FeatureGroupEngine.java
Outdated
Show resolved
Hide resolved
Closes #26 |
No description provided.