aminghadersohi commented on code in PR #45907:
URL: https://github.com/apache/superset/pull/45907#discussion_r4447967480


##########
superset/commands/semantic_layer/update.py:
##########
@@ -219,7 +219,19 @@ def run(self) -> Model:
                 self._properties["configuration"]
             )
         if "configuration" in self._properties:
-            self._model.clear_metadata_cache()
+            try:
+                unchanged: bool = json.dumps(
+                    json.loads(self._model.configuration or "{}"), 
sort_keys=True
+                ) == json.dumps(
+                    json.loads(self._properties["configuration"]), 
sort_keys=True
+                )

Review Comment:
   When stored configuration is `None` or `""`, saving a valid `{}` silently 
drops the repair on every retry, while `SemanticBindingMemo.bind()` still fails 
to parse it. For a provider accepting only `{}`, no valid update can recover 
the row.
   
   ```suggestion
                   unchanged: bool = json.dumps(
                       json.loads(self._model.configuration), sort_keys=True
                   ) == json.dumps(
                       json.loads(self._properties["configuration"]), 
sort_keys=True
                   )
   ```



-- 
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]

  • [PR] fix(se... mikebridge (via GitHub) via notifications
    • Re: [P... codecov[bot] (via GitHub) via notifications
    • Re: [P... netlify[bot] (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications
    • Re: [P... aminghadersohi (via GitHub) via notifications
    • Re: [P... mikebridge (via GitHub) via notifications
    • Re: [P... codeant-ai-for-open-source[bot] (via GitHub) via notifications
    • Re: [P... aminghadersohi (via GitHub) via notifications

Reply via email to