Copilot commented on code in PR #36076:
URL: https://github.com/apache/superset/pull/36076#discussion_r2524485619


##########
superset/utils/schema.py:
##########
@@ -50,4 +50,37 @@ def validate_json(value: Union[bytes, bytearray, str]) -> 
None:
     try:
         json.validate_json(value)
     except json.JSONDecodeError as ex:
-        raise ValidationError("JSON not valid") from ex
+        error_msg = "JSON not valid"
+        raise ValidationError(error_msg) from ex
+
+
+def validate_query_context_metadata(value: bytes | bytearray | str | None) -> 
None:

Review Comment:
   [nitpick] Inconsistent type annotation style. This file uses the older 
`Union[bytes, bytearray, str]` syntax on line 43, but the new function on line 
57 uses the modern Python 3.10+ union syntax `bytes | bytearray | str | None`. 
For consistency, consider using the same style throughout the file. Since line 
43 already uses `Union`, it would be more consistent to use `Union[bytes, 
bytearray, str, None]` here.
   ```suggestion
   def validate_query_context_metadata(value: Union[bytes, bytearray, str, 
None]) -> None:
   ```



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

Reply via email to