Skip to content

Commit

Permalink
Use JSONB type for XCom.value column in PostgreSQL (apache#44290)
Browse files Browse the repository at this point in the history
`JSONB` is more efficient, we already use that in migration, this makes it consistent when DB tables are created from ORM.
  • Loading branch information
kaxil authored Nov 22, 2024
1 parent 66407e8 commit fedfaa7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/models/xcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
select,
text,
)
from sqlalchemy.dialects import postgresql
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.orm import Query, reconstructor, relationship

Expand Down Expand Up @@ -79,7 +80,7 @@ class BaseXCom(TaskInstanceDependencies, LoggingMixin):
dag_id = Column(String(ID_LEN, **COLLATION_ARGS), nullable=False)
run_id = Column(String(ID_LEN, **COLLATION_ARGS), nullable=False)

value = Column(JSON)
value = Column(JSON().with_variant(postgresql.JSONB, "postgresql"))
timestamp = Column(UtcDateTime, default=timezone.utcnow, nullable=False)

__table_args__ = (
Expand Down

0 comments on commit fedfaa7

Please sign in to comment.