KoviAnusha commented on code in PR #57532:
URL: https://github.com/apache/airflow/pull/57532#discussion_r2530443026
##########
airflow-core/src/airflow/models/variable.py:
##########
@@ -242,31 +242,48 @@ def set(
is_encrypted = new_variable.is_encrypted
# Import dialect-specific insert function
- if (dialect_name := session.get_bind().dialect.name) ==
"postgresql":
- from sqlalchemy.dialects.postgresql import insert
- elif dialect_name == "mysql":
- from sqlalchemy.dialects.mysql import insert
- else:
- from sqlalchemy.dialects.sqlite import insert
+ dialect_name = get_dialect_name(session)
+ stmt: Any
+ if dialect_name == "postgresql":
+ from sqlalchemy.dialects.postgresql import insert as pg_insert
- # Create the insert statement (common for all dialects)
- stmt = insert(Variable).values(
- key=key,
- val=val,
- description=description,
- is_encrypted=is_encrypted,
- )
Review Comment:
Raised a separate pull request for this file:
https://github.com/apache/airflow/pull/58351
--
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]