jason810496 commented on code in PR #55735:
URL: https://github.com/apache/airflow/pull/55735#discussion_r2353712118


##########
airflow-core/src/airflow/api_fastapi/common/parameters.py:
##########
@@ -363,6 +364,13 @@ def to_orm(self, select: Select) -> Select:
                 return select.where(self.attribute.is_not(None))
             if self.value is True:
                 return select.where(self.attribute.is_(None))
+        if self.filter_option == FilterOptionEnum.CONTAINS:
+            # For JSON/JSONB columns, convert to text before applying LIKE
+            from sqlalchemy import JSON, Text, cast
+
+            if isinstance(self.attribute.type, JSON) or 
str(self.attribute.type).upper() in ("JSON", "JSONB"):

Review Comment:
   Just to make double check: Do we still need 
`str(self.attribute.type).upper() in ("JSON", "JSONB")` because 
`isinstance(self.attribute.type, JSON)` doesn't work for Postgres?
   
   Or maybe `isinstance(self.attribute.type, JSON)` can handle all database 
dialects?



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