ashb commented on code in PR #63899:
URL: https://github.com/apache/airflow/pull/63899#discussion_r2955605556
##########
airflow-core/src/airflow/models/variable.py:
##########
@@ -53,10 +53,10 @@ class Variable(Base, LoggingMixin):
__NO_DEFAULT_SENTINEL = object()
id: Mapped[int] = mapped_column(Integer, primary_key=True)
- key: Mapped[str] = mapped_column(String(ID_LEN), unique=True)
- _val: Mapped[str] = mapped_column("val", Text().with_variant(MEDIUMTEXT,
"mysql"))
+ key: Mapped[str | None] = mapped_column(String(ID_LEN), unique=True,
nullable=True)
Review Comment:
This should not be nullable
##########
airflow-core/src/airflow/models/connection.py:
##########
@@ -134,8 +134,8 @@ class Connection(Base, LoggingMixin):
login: Mapped[str | None] = mapped_column(Text(), nullable=True)
_password: Mapped[str | None] = mapped_column("password", Text(),
nullable=True)
port: Mapped[int | None] = mapped_column(Integer(), nullable=True)
- is_encrypted: Mapped[bool] = mapped_column(Boolean, unique=False,
default=False)
- is_extra_encrypted: Mapped[bool] = mapped_column(Boolean, unique=False,
default=False)
+ is_encrypted: Mapped[bool | None] = mapped_column(Boolean, unique=False,
default=False)
Review Comment:
These _could_ be left non nullable - false and not null are equivalent for
where is used
##########
airflow-core/src/airflow/models/dag.py:
##########
@@ -348,7 +348,7 @@ class DagModel(Base):
# A DAG can be paused from the UI / DB
# Set this default value of is_paused based on a configuration value!
is_paused_at_creation = airflow_conf.getboolean("core",
"dags_are_paused_at_creation")
- is_paused: Mapped[bool] = mapped_column(Boolean,
default=is_paused_at_creation)
+ is_paused: Mapped[bool | None] = mapped_column(Boolean,
default=is_paused_at_creation)
Review Comment:
Ditto here - null = false = not paused
--
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]