eric-maynard commented on code in PR #1959:
URL: https://github.com/apache/polaris/pull/1959#discussion_r2183969681


##########
polaris-core/src/main/java/org/apache/polaris/core/config/PolarisConfiguration.java:
##########
@@ -86,18 +102,32 @@ public static List<PolarisConfiguration<?>> 
getAllConfigurations() {
   @SuppressWarnings("unchecked")
   protected PolarisConfiguration(
       String key,
+      Set<String> legacyKeys,
       String description,
       T defaultValue,
       Optional<String> catalogConfig,
       Optional<String> catalogConfigUnsafe) {
     this.key = key;
+    this.legacyKeys = legacyKeys;
     this.description = description;
     this.defaultValue = defaultValue;
     this.catalogConfigImpl = catalogConfig;
     this.catalogConfigUnsafeImpl = catalogConfigUnsafe;
     this.typ = (Class<T>) defaultValue.getClass();
   }
 
+  public boolean hasLegacyKeys() {
+    return !legacyKeys.isEmpty();
+  }
+
+  public String legacyKeys() {
+    if (legacyKeys.isEmpty()) {
+      throw new IllegalStateException(
+          "Attempted to read legacy keys from a configuration that doesn't 
have any.");

Review Comment:
   This doesn't look right to me; the check is there for `catalogConfig` 
because it's not correct to call the variant of `getConfiguration` which takes 
a catalog when a config doesn't have a `catalogConfig`. However we should 
always be checking legacyKeys every time we load any config.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@polaris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to