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


##########
airflow/models/dagwarning.py:
##########
@@ -0,0 +1,93 @@
+#
+# 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.
+from enum import Enum
+
+from sqlalchemy import Column, ForeignKeyConstraint, Integer, String, Text, 
false
+
+from airflow.models.base import ID_LEN, Base
+from airflow.utils import timezone
+from airflow.utils.session import NEW_SESSION, provide_session
+from airflow.utils.sqlalchemy import UtcDateTime
+
+
+class DagWarning(Base):
+    """
+    A table to store DAG warnings.
+
+    DAG warnings are problems that don't rise to the level of failing the DAG 
parse
+    but which users should nonetheless be warned about.  These warnings are 
recorded
+    when parsing DAG and displayed on the Webserver in a flash message.
+    """
+
+    id = Column(
+        Integer, autoincrement=True, server_default='id'
+    )  # this default just signals to SQLA to defer to server

Review Comment:
   Do we need the default? I think `autoincrement` will add the needed default. 
Also, this table has primary key on `dag_id`, `warning_type` but the migration 
doesn't have these columns as the primary key. Both should have the same 
configuration? 
   Only the ID field is a primary key on the migration file



-- 
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]

Reply via email to