dstandish commented on code in PR #39246:
URL: https://github.com/apache/airflow/pull/39246#discussion_r1579933342
##########
airflow/migrations/versions/0140_2_9_0_update_trigger_kwargs_type.py:
##########
@@ -38,13 +42,43 @@
airflow_version = "2.9.0"
+def get_session() -> sa.orm.Session:
+ conn = op.get_bind()
+ sessionmaker = sa.orm.sessionmaker()
+ return sessionmaker(bind=conn)
+
def upgrade():
- """Update trigger kwargs type to string"""
+ """Update trigger kwargs type to string and encrypt"""
with op.batch_alter_table("trigger") as batch_op:
batch_op.alter_column("kwargs", type_=sa.Text(), )
+ if not context.is_offline_mode():
Review Comment:
very much a style thing, but i think doing a pre-emptive return better
reveals the intention in this case
i.e. `if context.is_offline_mode(): return` but feel free to disregard
sorta just makes it easier to see what "the main migration" is ... indented
makes it look like it's conditional
--
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]