jscheffl commented on code in PR #51716:
URL: https://github.com/apache/airflow/pull/51716#discussion_r2146980317
##########
providers/edge3/src/airflow/providers/edge3/executors/edge_executor.py:
##########
@@ -73,12 +73,23 @@ def _check_db_schema(self, engine: Engine) -> None:
inspector = inspect(engine)
edge_job_columns = None
with contextlib.suppress(NoSuchTableError):
- edge_job_columns = [column["name"] for column in
inspector.get_columns("edge_job")]
+ edge_job_schema = inspector.get_columns("edge_job")
+ edge_job_columns = [column["name"] for column in edge_job_schema]
+ for column in edge_job_schema:
+ if column["name"] == "command":
+ edge_job_command_len = column["type"].length
# version 0.6.0rc1 added new column concurrency_slots
if edge_job_columns and "concurrency_slots" not in edge_job_columns:
EdgeJobModel.metadata.drop_all(engine,
tables=[EdgeJobModel.__table__])
+ # version 1.1.0 the command column was changed to VARCHAR(2048)
+ if edge_job_command_len and edge_job_command_len != 2048:
Review Comment:
Just a small nit now... I don't know if this will happen in real life but if
the table is dropped inthe lines above the migration will fail here. So to be
safe we need `elif`:
```suggestion
elif edge_job_command_len and edge_job_command_len != 2048:
```
--
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]