sadpandajoe commented on code in PR #45546:
URL: https://github.com/apache/superset/pull/45546#discussion_r4395444069


##########
superset/commands/dataset/update.py:
##########
@@ -608,29 +613,31 @@ def _validate_partition_mapping(self, exceptions: 
list[ValidationError]) -> None
                     ValidationError(reason, 
field_name="partition_value_transform")
                 )
 
-    def _effective_transform(
+    def _effective_column_attribute(
         self,
         columns: list[dict[str, Any]] | None,
-        mapped_column: str | None,
+        column_name: str | None,
+        attribute: str,
     ) -> str | None:
         """
-        The value transform on the effective mapped column.
+        One attribute of a named column, as this request will leave it.
 
         Reads from the payload when the request carries columns, and from the
         persisted model otherwise -- a PUT that changes only `partition_column`
-        still has to be validated against the transform already stored.
+        still has to be validated against the transform already stored, and
+        against the expression of the column it now names.
         """
-        if not mapped_column:
+        if not column_name:
             return None
         if columns is not None:
             for column in columns:
-                if column.get("column_name") == mapped_column:
-                    return column.get("partition_value_transform")
+                if column.get("column_name") == column_name:
+                    return column.get(attribute)

Review Comment:
   Agreed—a PUT whose column entry carries an `id` but omits `expression` 
leaves the stored Jinja expression untouched in `_upsert_columns`, yet 
`_effective_column_attribute` reads `None` from the payload entry, so the new 
blocking check is skipped and the save is accepted. The mapping then silently 
stays inactive at query time instead of the owner seeing the error. Should the 
payload branch fall back to the persisted column's value when the key is absent?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

  • Re: [PR] fi... via GitHub
    • Re: [P... via GitHub
    • Re: [P... via GitHub
    • Re: [P... via GitHub
    • Re: [P... github-actions[bot] (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications
    • Re: [P... sadpandajoe (via GitHub) via notifications
    • Re: [P... hughhhh (via GitHub) via notifications
    • Re: [P... hughhhh (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications

Reply via email to