Dev-iL commented on code in PR #55954:
URL: https://github.com/apache/airflow/pull/55954#discussion_r2371020005


##########
airflow-core/src/airflow/models/team.py:
##########
@@ -19,16 +19,27 @@
 
 import uuid6
 from sqlalchemy import Column, ForeignKey, Index, String, Table
-from sqlalchemy.orm import relationship
+
+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)
+
+
+from sqlalchemy.orm import Mapped, relationship
 from sqlalchemy_utils import UUIDType
 
 from airflow.models.base import Base
 
 dag_bundle_team_association_table = Table(
     "dag_bundle_team",
     Base.metadata,
-    Column("dag_bundle_name", ForeignKey("dag_bundle.name", 
ondelete="CASCADE"), primary_key=True),
-    Column("team_id", ForeignKey("team.id", ondelete="CASCADE"), 
primary_key=True),
+    Column("dag_bundle_name", String, ForeignKey("dag_bundle.name", 
ondelete="CASCADE"), primary_key=True),

Review Comment:
   So now it's incompatible with 
https://github.com/apache/airflow/pull/55954/files#diff-019dee28e24ba20a93b35e5fc8011e4b9e13ab98eb8d26fd3c85ce38b58ad6a3R56
 (which is StringID, i.e. a string with a length, which should be fine) - I 
think the class can be dropped altogether and let it populate through the FK 
constraint.
   
   Why was the class specified here anyway?



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