-
Notifications
You must be signed in to change notification settings - Fork 176
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
Enable casting config values of most types #343
Enable casting config values of most types #343
Conversation
polaris-core/src/main/java/org/apache/polaris/core/PolarisConfigurationStore.java
Outdated
Show resolved
Hide resolved
polaris-core/src/main/java/org/apache/polaris/core/PolarisConfigurationStore.java
Outdated
Show resolved
Hide resolved
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.
LGTM!
/** Unit test for the default behaviors of the PolarisConfigurationStore interface. */ | ||
public class PolarisConfigurationStoreTest { | ||
@Test | ||
public void testConfigsCanBeCastedFromString() { |
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.
Can we also add a test for the negative case? e.g. a string is provided for an int
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.
Added
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.
LGTM, looks good to merge
Description
Implementations of PolarisConfigurationStore may return strings regardless of the config type. In particular, one place where this happens when specifying a ConfigOverride in a test.
Currently, the interface checks the expected type for booleans and Lists and casts them to the correct config type. Whether this is a pattern we should proliferate or not is up for debate, but this PR simply extends the existing logic to work for other types, and it adds tests to ensure the different castings work. Without this PR, the test fails.
Type of change
How Has This Been Tested?
Checklist: