fabbuc-gyg commented on code in PR #70385:
URL: https://github.com/apache/airflow/pull/70385#discussion_r3933816915


##########
providers/databricks/src/airflow/providers/databricks/utils/databricks.py:
##########
@@ -17,9 +17,22 @@
 # under the License.
 from __future__ import annotations
 
+import re
+
 from airflow.providers.common.compat.sdk import AirflowException, XComArg
 from airflow.providers.databricks.hooks.databricks import DatabricksHook, 
RunState
 
+_JSONB_INVALID_CHARS = re.compile(r"[\x00\ud800-\udfff]")
+
+
+def make_jsonb_safe(error: str | int) -> str | int:
+    """

Review Comment:
   Fixed — docstring is now a single line. Also installed `prek` locally so 
this class of failure gets caught before pushing. Thanks for the pointer.



##########
providers/databricks/src/airflow/providers/databricks/utils/databricks.py:
##########
@@ -17,9 +17,22 @@
 # under the License.
 from __future__ import annotations
 
+import re
+
 from airflow.providers.common.compat.sdk import AirflowException, XComArg
 from airflow.providers.databricks.hooks.databricks import DatabricksHook, 
RunState
 
+_JSONB_INVALID_CHARS = re.compile(r"[\x00\ud800-\udfff]")
+
+
+def make_jsonb_safe(error: str | int) -> str | int:

Review Comment:
   Agreed, changed to `error: Any -> Any`. `str | int` was misleading — `int` 
was never a meaningful case, the guard is just there to be defensive about 
whatever Databricks puts in `run_output["error"]`.



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

Reply via email to