You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/07/12 11:53:04 UTC

[airflow] branch main updated: D400 first line should end with period two files batch 01 (#24955)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new b83fe214c8 D400 first line should end with period two files batch 01 (#24955)
b83fe214c8 is described below

commit b83fe214c882b98c41e54fe39ad5d7d335e32123
Author: Edith Puclla <58...@users.noreply.github.com>
AuthorDate: Tue Jul 12 06:52:47 2022 -0500

    D400 first line should end with period two files batch 01 (#24955)
---
 ...10_5_change_datetime_to_datetime2_6_on_mssql_.py | 21 ++++++++++-----------
 .../0113_2_4_0_compare_types_between_orm_and_db.py  |  6 +++---
 docs/apache-airflow/migrations-ref.rst              |  4 ++--
 3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/airflow/migrations/versions/0046_1_10_5_change_datetime_to_datetime2_6_on_mssql_.py b/airflow/migrations/versions/0046_1_10_5_change_datetime_to_datetime2_6_on_mssql_.py
index 49e3e9b84a..9b0773fc8d 100644
--- a/airflow/migrations/versions/0046_1_10_5_change_datetime_to_datetime2_6_on_mssql_.py
+++ b/airflow/migrations/versions/0046_1_10_5_change_datetime_to_datetime2_6_on_mssql_.py
@@ -16,7 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-"""change datetime to datetime2(6) on MSSQL tables
+"""change datetime to datetime2(6) on MSSQL tables.
 
 Revision ID: 74effc47d867
 Revises: 6e96a59344a4
@@ -38,7 +38,7 @@ airflow_version = '1.10.5'
 
 
 def upgrade():
-    """Change datetime to datetime2(6) when using MSSQL as backend"""
+    """Change datetime to datetime2(6) when using MSSQL as backend."""
     conn = op.get_bind()
     if conn.dialect.name == "mssql":
         result = conn.execute(
@@ -149,7 +149,7 @@ def upgrade():
 
 
 def downgrade():
-    """Change datetime2(6) back to datetime"""
+    """Change datetime2(6) back to datetime."""
     conn = op.get_bind()
     if conn.dialect.name == "mssql":
         result = conn.execute(
@@ -242,7 +242,8 @@ def downgrade():
 
 
 def get_table_constraints(conn, table_name):
-    """
+    """Return primary and unique constraint along with column name.
+
     This function return primary and unique constraint
     along with column name. some tables like task_instance
     is missing primary key constraint name and the name is
@@ -268,8 +269,8 @@ def get_table_constraints(conn, table_name):
 
 
 def reorder_columns(columns):
-    """
-    Reorder the columns for creating constraint, preserve primary key ordering
+    """Reorder the columns for creating constraint.
+    Preserve primary key ordering
     ``['task_id', 'dag_id', 'execution_date']``
 
     :param columns: columns retrieved from DB related to constraint
@@ -288,8 +289,7 @@ def reorder_columns(columns):
 
 
 def drop_constraint(operator, constraint_dict):
-    """
-    Drop a primary key or unique constraint
+    """Drop a primary key or unique constraint.
 
     :param operator: batch_alter_table for the table
     :param constraint_dict: a dictionary of ((constraint name, constraint type), column name) of table
@@ -303,8 +303,7 @@ def drop_constraint(operator, constraint_dict):
 
 
 def create_constraint(operator, constraint_dict):
-    """
-    Create a primary key or unique constraint
+    """Create a primary key or unique constraint.
 
     :param operator: batch_alter_table for the table
     :param constraint_dict: a dictionary of ((constraint name, constraint type), column name) of table
@@ -320,7 +319,7 @@ def create_constraint(operator, constraint_dict):
 
 
 def modify_execution_date_with_constraint(conn, batch_operator, table_name, type_, nullable):
-    """
+    """Change type of column execution_date.
     Helper function changes type of column execution_date by
     dropping and recreating any primary/unique constraint associated with
     the column
diff --git a/airflow/migrations/versions/0113_2_4_0_compare_types_between_orm_and_db.py b/airflow/migrations/versions/0113_2_4_0_compare_types_between_orm_and_db.py
index 68f02dd81e..19f6e790fb 100644
--- a/airflow/migrations/versions/0113_2_4_0_compare_types_between_orm_and_db.py
+++ b/airflow/migrations/versions/0113_2_4_0_compare_types_between_orm_and_db.py
@@ -16,7 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-"""compare types between ORM and DB
+"""compare types between ORM and DB.
 
 Revision ID: 44b7034f6bdc
 Revises: 424117c37d18
@@ -38,7 +38,7 @@ airflow_version = '2.4.0'
 
 
 def upgrade():
-    """Apply compare types between ORM and DB"""
+    """Apply compare types between ORM and DB."""
     conn = op.get_bind()
     with op.batch_alter_table('connection', schema=None) as batch_op:
         batch_op.alter_column(
@@ -151,7 +151,7 @@ def upgrade():
 
 
 def downgrade():
-    """Unapply compare types between ORM and DB"""
+    """Unapply compare types between ORM and DB."""
     with op.batch_alter_table('connection', schema=None) as batch_op:
         batch_op.alter_column(
             'extra',
diff --git a/docs/apache-airflow/migrations-ref.rst b/docs/apache-airflow/migrations-ref.rst
index e5a5b13fa6..698da4ffab 100644
--- a/docs/apache-airflow/migrations-ref.rst
+++ b/docs/apache-airflow/migrations-ref.rst
@@ -29,7 +29,7 @@ Here's the list of all the Database Migrations that are executed via when you ru
 +=================================+===================+===================+==============================================================+
 | ``0038cd0c28b4`` (head)         | ``44b7034f6bdc``  | ``2.4.0``         | Add Dataset model                                            |
 +---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
-| ``44b7034f6bdc``                | ``424117c37d18``  | ``2.4.0``         | compare types between ORM and DB                             |
+| ``44b7034f6bdc``                | ``424117c37d18``  | ``2.4.0``         | compare types between ORM and DB.                            |
 +---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
 | ``424117c37d18``                | ``f5fcbda3e651``  | ``2.4.0``         | Add DagWarning model                                         |
 +---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
@@ -180,7 +180,7 @@ Here's the list of all the Database Migrations that are executed via when you ru
 +---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
 | ``004c1210f153``                | ``939bb1e647c8``  | ``1.10.4``        | Increase queue name size limit                               |
 +---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
-| ``74effc47d867``                | ``6e96a59344a4``  | ``1.10.5``        | change datetime to datetime2(6) on MSSQL tables              |
+| ``74effc47d867``                | ``6e96a59344a4``  | ``1.10.5``        | change datetime to datetime2(6) on MSSQL tables.             |
 +---------------------------------+-------------------+-------------------+--------------------------------------------------------------+
 | ``b3b105409875``                | ``d38e04c12aa2``  | ``1.10.7``        | Add ``root_dag_id`` to ``DAG``                               |
 +---------------------------------+-------------------+-------------------+--------------------------------------------------------------+