YuriyKrasilnikov commented on code in PR #37790:
URL: https://github.com/apache/superset/pull/37790#discussion_r2783894108
##########
superset/dashboards/schemas.py:
##########
@@ -257,8 +273,121 @@ def post_dump(self, serialized: dict[str, Any], **kwargs:
Any) -> dict[str, Any]
del serialized["owners"]
del serialized["changed_by_name"]
del serialized["changed_by"]
+
+ # Apply content localization when feature is enabled
+ if is_feature_enabled("ENABLE_CONTENT_LOCALIZATION"):
+ self._apply_localization(serialized, obj)
+
return serialized
+ def _apply_localization(self, serialized: dict[str, Any], obj: Any) ->
None:
Review Comment:
False positive. \`validate_translations()\` explicitly accepts \`None\`:
1. Type signature: \`translations: dict[str, dict[str, str]] | None\`
2. First line: \`if translations is None: return\`
3. Docstring: \`>>> validate_translations(None) # passes (clears
translations)\`
4. Dedicated test: \`test_validate_translations_none_passes\` in
\`validation_test.py:144\`
Same issue was flagged on the previous review round at \`schemas.py:606\` —
already answered there.
--
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]