shahar1 commented on code in PR #74445: URL: https://github.com/apache/airflow/pull/74445#discussion_r4458469328
########## providers/edge3/src/airflow/providers/edge3/migrations/versions/0008_5_1_0_widen_edge_job_command.py: ########## @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +""" +Change edge_job.command to unbounded text. + +Revision ID: cd96a0a0e458 +Revises: d5a2f8b41c07 +Create Date: 2026-10-08 00:00:00.000000 +""" + +from __future__ import annotations + +import sqlalchemy as sa +from alembic import op + +revision = "cd96a0a0e458" +down_revision = "d5a2f8b41c07" +branch_labels = None +depends_on = None +edge3_version = "5.1.0" Review Comment: major — Database / query correctness: the migration is labelled with a version that has already been released. > Those migration details are mostly used here to make the users aware when and what kind of migrations will be executed during migrations between specific Edge3 provider versions. The intention here is that the "DB conscious" users might perform an analysis on the migrations and draw conclusions about the impact of the migrations on their Airflow database. (`providers/edge3/docs/migrations-ref.rst`) This answers the open version question: edge3 `5.1.0` has been released since this PR was opened (https://github.com/apache/airflow/pull/75209, 2026-10-20) with `d5a2f8b41c07` as its migration head, so this migration cannot be part of `5.1.0`. As the branch stands, the file name, `edge3_version`, the `migrations-ref.rst` row and `_REVISION_HEADS_MAP["5.1.0"]` all claim it shipped in `5.1.0`, and the map now points `5.1.0` at `cd96a0a0e458`, which `airflow db-manager downgrade --to-version 5.1.0` would resolve to instead of the real `5.1.0` head. The next version is `5.2.0`: rename the file to `0008_5_2_0_widen_edge_job_command.py`, set `edge3_version = "5.2.0"`, keep `"5.1.0": "d5a2f8b41c07"` in `_REVISION_HEADS_MAP` and add `"5.2.0": "cd96a0a0e458"` below it (the `check-revision-heads-map` prek hook regenerates the map from the migration files), and change the `Edge3 Version` cell of the new `migrations-ref.rst` row to `5.2.0`. ```suggestion edge3_version = "5.2.0" ``` ########## providers/edge3/src/airflow/providers/edge3/models/edge_job.py: ########## @@ -85,7 +86,7 @@ class EdgeJobModel(Base, LoggingMixin): queue: Mapped[str] = mapped_column(String(256)) concurrency_slots: Mapped[int] = mapped_column(Integer) priority_weight: Mapped[int] = mapped_column(Integer, nullable=False, server_default=text("1")) - command: Mapped[str] = mapped_column(String(2048)) + command: Mapped[str] = mapped_column(Text) Review Comment: minor — Database / query correctness: "Flag any database-specific SQL without cross-DB handling. SQL must work on PostgreSQL, MySQL, and SQLite." > **Flag any database-specific SQL** (e.g., `LATERAL` joins, PostgreSQL-only functions, MySQL-only syntax) without cross-DB handling. SQL must work on PostgreSQL, MySQL, and SQLite. On MySQL a plain `TEXT` holds 65,535 bytes, while the Dag run `conf` that the `SyncCallback` snapshot carries is a JSON column with no such cap, so a large `conf` would hit the same "data too long" crash loop on MySQL that this PR fixes on PostgreSQL. The provider already uses `Text().with_variant(MEDIUMTEXT(), "mysql")` for `edge_logs.log_chunk_data` (model and the `0001` migration); the same variant here, and as `type_=` in the new migration's `upgrade()`, keeps the column unbounded on all three backends. `mysql` is already imported in this module. ```suggestion command: Mapped[str] = mapped_column(Text().with_variant(mysql.MEDIUMTEXT(), "mysql")) ``` -- 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]
