vincbeck commented on code in PR #55954:
URL: https://github.com/apache/airflow/pull/55954#discussion_r2382788288
##########
airflow-core/src/airflow/models/backfill.py:
##########
@@ -39,7 +38,18 @@
select,
)
from sqlalchemy.exc import IntegrityError
-from sqlalchemy.orm import relationship, validates
+
+try:
+ from sqlalchemy.orm import mapped_column
+except ImportError:
+ # fallback for SQLAlchemy < 2.0
+ def mapped_column(*args, **kwargs):
+ from sqlalchemy import Column
+
+ return Column(*args, **kwargs)
Review Comment:
I updated the PR and move this logic in `airflow.utils.sqlalchemy`
##########
airflow-core/src/airflow/models/backfill.py:
##########
@@ -39,7 +38,18 @@
select,
)
from sqlalchemy.exc import IntegrityError
-from sqlalchemy.orm import relationship, validates
+
+try:
+ from sqlalchemy.orm import mapped_column
+except ImportError:
+ # fallback for SQLAlchemy < 2.0
+ def mapped_column(*args, **kwargs):
+ from sqlalchemy import Column
+
+ return Column(*args, **kwargs)
Review Comment:
I updated the PR and moved this logic in `airflow.utils.sqlalchemy`
--
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]