SameerMesiah97 commented on code in PR #67323:
URL: https://github.com/apache/airflow/pull/67323#discussion_r3532088509


##########
airflow-core/src/airflow/models/hitl.py:
##########
@@ -61,11 +61,21 @@ def compile_postgres(element: JSONExtract, compiler: 
SQLCompiler, **kwargs: dict
     return compiler.process(func.json_extract_path_text(column, key), **kwargs)
 
 
-@compiles(JSONExtract, "sqlite")
 @compiles(JSONExtract, "mysql")
-def compile_sqlite_mysql(element: JSONExtract, compiler: SQLCompiler, 
**kwargs: dict[str, Any]) -> str:
+def compile_mysql(element: JSONExtract, compiler: SQLCompiler, **kwargs: 
dict[str, Any]) -> str:
+    """
+    Compile JSONExtract for MySQL.
+
+    :meta: private
+    """
+    column, key = element.clauses
+    return compiler.process(func.json_unquote(func.json_extract(column, 
f"$.{key.value}")), **kwargs)

Review Comment:
   Minor readability suggestion: would it be worth assigning the extracted JSON 
value to an intermediate variable before wrapping it in `json_unquote()`? The 
nested function call took me a moment to parse.



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