ephraimbuddy commented on code in PR #42277:
URL: https://github.com/apache/airflow/pull/42277#discussion_r1763603624


##########
airflow/migrations/versions/0032_3_0_0_add_tables_for_backfill.py:
##########
@@ -0,0 +1,88 @@
+#
+# 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.
+
+"""
+Add tables for backfill.
+
+Revision ID: 522625f6d606
+Revises: 1cdc775ca98f
+Create Date: 2024-08-23 14:26:08.250493
+
+"""
+
+from __future__ import annotations
+
+import sqlalchemy as sa
+import sqlalchemy_jsonfield
+from alembic import op
+
+import airflow
+
+# revision identifiers, used by Alembic.
+revision = "522625f6d606"
+down_revision = "1cdc775ca98f"
+branch_labels = None
+depends_on = None
+airflow_version = "3.0.0"
+
+
+def upgrade():
+    """Apply Add tables for backfill."""
+    # ### commands auto generated by Alembic - please adjust! ###

Review Comment:
   ```suggestion
   ```
   We can remove this and some other ones like it



##########
airflow/migrations/versions/0032_3_0_0_add_tables_for_backfill.py:
##########
@@ -0,0 +1,88 @@
+#
+# 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.
+
+"""
+Add tables for backfill.
+
+Revision ID: 522625f6d606
+Revises: 1cdc775ca98f
+Create Date: 2024-08-23 14:26:08.250493
+
+"""
+
+from __future__ import annotations
+
+import sqlalchemy as sa
+import sqlalchemy_jsonfield
+from alembic import op
+
+import airflow
+
+# revision identifiers, used by Alembic.
+revision = "522625f6d606"
+down_revision = "1cdc775ca98f"
+branch_labels = None
+depends_on = None
+airflow_version = "3.0.0"
+
+
+def upgrade():
+    """Apply Add tables for backfill."""
+    # ### commands auto generated by Alembic - please adjust! ###
+    op.create_table(
+        "backfill",
+        sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
+        sa.Column("dag_id", sa.String(length=250), nullable=True),
+        sa.Column("from_date", 
airflow.utils.sqlalchemy.UtcDateTime(timezone=True), nullable=False),
+        sa.Column("to_date", 
airflow.utils.sqlalchemy.UtcDateTime(timezone=True), nullable=False),
+        sa.Column("dag_run_conf", sqlalchemy_jsonfield.jsonfield.JSONField(), 
nullable=True),
+        sa.Column("is_paused", sa.Boolean(), nullable=True),
+        sa.Column("max_active_runs", sa.Integer(), nullable=False),
+        sa.Column("created_at", 
airflow.utils.sqlalchemy.UtcDateTime(timezone=True), nullable=False),
+        sa.Column("completed_at", 
airflow.utils.sqlalchemy.UtcDateTime(timezone=True), nullable=True),
+        sa.Column("updated_at", 
airflow.utils.sqlalchemy.UtcDateTime(timezone=True), nullable=False),
+        sa.PrimaryKeyConstraint("id", name=op.f("backfill_pkey")),
+    )
+    op.create_table(
+        "backfill_dag_run",
+        sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
+        sa.Column("backfill_id", sa.Integer(), nullable=False),
+        sa.Column("dag_run_id", sa.Integer(), nullable=True),

Review Comment:
   Does this mean we can have a backfill without a dagrun or should we make it 
nullable=False?



##########
airflow/models/__init__.py:
##########
@@ -23,6 +23,8 @@
 __all__ = [
     "DAG",
     "ID_LEN",
+    "Backfill",
+    "BackfillDagRun",

Review Comment:
   There's an instruction not to add new models to this at line 22 above..



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to