You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/12/07 16:43:54 UTC

[GitHub] [airflow] potiuk opened a new pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

potiuk opened a new pull request #12890:
URL: https://github.com/apache/airflow/pull/12890


   This change increases the maximum amount of code one can store
   in dag_code in MySQL. The limit for TEXT is 64KB where for
   MEDIUMTEXT is 16MB.
   
   Fixes #12776
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   


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

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



[GitHub] [airflow] ashb commented on pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
ashb commented on pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#issuecomment-740213280


   > Updated. And fixed the inconsistent style elsewehere.
   
   Oh sorry - didn't mean to race you!


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

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



[GitHub] [airflow] github-actions[bot] commented on pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#issuecomment-740099076


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


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

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



[GitHub] [airflow] potiuk commented on a change in pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#discussion_r537869316



##########
File path: airflow/migrations/versions/e959f08ac86c_change_field_in_dagcode_to_mediumtext_.py
##########
@@ -0,0 +1,43 @@
+#
+# 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 field in DagCode to MEDIUMTEXT for MySql
+
+Revision ID: e959f08ac86c
+Revises: 64a7d6477aae
+Create Date: 2020-12-07 16:31:43.982353
+
+"""
+from alembic import context, op
+from sqlalchemy.dialects import mysql
+
+# revision identifiers, used by Alembic.
+revision = 'e959f08ac86c'
+down_revision = '64a7d6477aae'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():  # noqa: D103
+    if context.config.get_main_option('sqlalchemy.url').startswith('mysql'):

Review comment:
       Just to be a more empathethic to anyone who in the future could choose a  non-preferred example as a start.




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

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



[GitHub] [airflow] potiuk commented on a change in pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#discussion_r537662692



##########
File path: airflow/migrations/versions/e959f08ac86c_change_field_in_dagcode_to_mediumtext_.py
##########
@@ -0,0 +1,43 @@
+#
+# 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 field in DagCode to MEDIUMTEXT for MySql
+
+Revision ID: e959f08ac86c
+Revises: 64a7d6477aae
+Create Date: 2020-12-07 16:31:43.982353
+
+"""
+from alembic import context, op
+from sqlalchemy.dialects import mysql
+
+# revision identifiers, used by Alembic.
+revision = 'e959f08ac86c'
+down_revision = '64a7d6477aae'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():  # noqa: D103
+    if context.config.get_main_option('sqlalchemy.url').startswith('mysql'):

Review comment:
       (And I would rather tkeep consistency with the very similar change).




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

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



[GitHub] [airflow] mik-laj commented on a change in pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#discussion_r537658797



##########
File path: airflow/migrations/versions/e959f08ac86c_change_field_in_dagcode_to_mediumtext_.py
##########
@@ -0,0 +1,43 @@
+#
+# 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 field in DagCode to MEDIUMTEXT for MySql
+
+Revision ID: e959f08ac86c
+Revises: 64a7d6477aae
+Create Date: 2020-12-07 16:31:43.982353
+
+"""
+from alembic import context, op
+from sqlalchemy.dialects import mysql
+
+# revision identifiers, used by Alembic.
+revision = 'e959f08ac86c'
+down_revision = '64a7d6477aae'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():  # noqa: D103
+    if context.config.get_main_option('sqlalchemy.url').startswith('mysql'):

Review comment:
       ```suggestion
       conn = op.get_bind()  # pylint: disable=no-member
       if conn.dialect.name == "mysql":
   ```
   See: https://github.com/apache/airflow/blob/4fb312140fc15b46fa96e98ec0e3939d81109eb6/airflow/migrations/versions/61ec73d9401f_add_description_field_to_connection.py#L42




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

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



[GitHub] [airflow] ashb commented on a change in pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#discussion_r537870690



##########
File path: airflow/migrations/versions/e959f08ac86c_change_field_in_dagcode_to_mediumtext_.py
##########
@@ -0,0 +1,43 @@
+#
+# 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 field in DagCode to MEDIUMTEXT for MySql
+
+Revision ID: e959f08ac86c
+Revises: 64a7d6477aae
+Create Date: 2020-12-07 16:31:43.982353
+
+"""
+from alembic import context, op
+from sqlalchemy.dialects import mysql
+
+# revision identifiers, used by Alembic.
+revision = 'e959f08ac86c'
+down_revision = '64a7d6477aae'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():  # noqa: D103
+    if context.config.get_main_option('sqlalchemy.url').startswith('mysql'):

Review comment:
       Opened PR #12898 




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

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



[GitHub] [airflow] ashb commented on a change in pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#discussion_r537875675



##########
File path: airflow/migrations/versions/4addfa1236f1_add_fractional_seconds_to_mysql_tables.py
##########
@@ -35,7 +35,7 @@
 
 
 def upgrade():  # noqa: D103
-    conn = op.get_bind()
+    conn = op.get_bind()  # pylint: disable=no-member

Review comment:
       I'm not sure this is strictly necessary - I copied it from other examples.
   
   Do we not pylint migrations maybe?




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

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



[GitHub] [airflow] potiuk commented on a change in pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#discussion_r537662157



##########
File path: airflow/migrations/versions/e959f08ac86c_change_field_in_dagcode_to_mediumtext_.py
##########
@@ -0,0 +1,43 @@
+#
+# 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 field in DagCode to MEDIUMTEXT for MySql
+
+Revision ID: e959f08ac86c
+Revises: 64a7d6477aae
+Create Date: 2020-12-07 16:31:43.982353
+
+"""
+from alembic import context, op
+from sqlalchemy.dialects import mysql
+
+# revision identifiers, used by Alembic.
+revision = 'e959f08ac86c'
+down_revision = '64a7d6477aae'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():  # noqa: D103
+    if context.config.get_main_option('sqlalchemy.url').startswith('mysql'):

Review comment:
       I used this as a base:
   
   https://github.com/apache/airflow/blob/4fb312140fc15b46fa96e98ec0e3939d81109eb6/airflow/migrations/versions/d2ae31099d61_increase_text_size_for_mysql.py#L37
   
   And I think it's more "universal" in a way.
   
   
   
   
   




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

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



[GitHub] [airflow] potiuk commented on a change in pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#discussion_r537867728



##########
File path: airflow/migrations/versions/e959f08ac86c_change_field_in_dagcode_to_mediumtext_.py
##########
@@ -0,0 +1,43 @@
+#
+# 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 field in DagCode to MEDIUMTEXT for MySql
+
+Revision ID: e959f08ac86c
+Revises: 64a7d6477aae
+Create Date: 2020-12-07 16:31:43.982353
+
+"""
+from alembic import context, op
+from sqlalchemy.dialects import mysql
+
+# revision identifiers, used by Alembic.
+revision = 'e959f08ac86c'
+down_revision = '64a7d6477aae'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():  # noqa: D103
+    if context.config.get_main_option('sqlalchemy.url').startswith('mysql'):

Review comment:
       OK. If there are no drawbacks, but we should change all of them not only this one.




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

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



[GitHub] [airflow] potiuk commented on pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#issuecomment-740211539


   Updated. And fixed the inconsistent style elsewehere.


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

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



[GitHub] [airflow] potiuk commented on pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#issuecomment-740037634


   cc: @rmanvar-indeed
   


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

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



[GitHub] [airflow] potiuk merged pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
potiuk merged pull request #12890:
URL: https://github.com/apache/airflow/pull/12890


   


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

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



[GitHub] [airflow] ashb commented on a change in pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#discussion_r537860951



##########
File path: airflow/migrations/versions/e959f08ac86c_change_field_in_dagcode_to_mediumtext_.py
##########
@@ -0,0 +1,43 @@
+#
+# 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 field in DagCode to MEDIUMTEXT for MySql
+
+Revision ID: e959f08ac86c
+Revises: 64a7d6477aae
+Create Date: 2020-12-07 16:31:43.982353
+
+"""
+from alembic import context, op
+from sqlalchemy.dialects import mysql
+
+# revision identifiers, used by Alembic.
+revision = 'e959f08ac86c'
+down_revision = '64a7d6477aae'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():  # noqa: D103
+    if context.config.get_main_option('sqlalchemy.url').startswith('mysql'):

Review comment:
       The op.get_bind() style is used much more:
   
   ```
   co~/code/airflow/airflow master*
   airflow ❯ git grep conn.dialect.name ./airflow/migrations/versions | wc -l
   54
   
   ~/code/airflow/airflow master*
   airflow ❯ git grep context.config.get_main_option ./airflow/migrations/versions | wc -l
   4
   ```




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

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



[GitHub] [airflow] potiuk commented on a change in pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#discussion_r537664326



##########
File path: airflow/migrations/versions/e959f08ac86c_change_field_in_dagcode_to_mediumtext_.py
##########
@@ -0,0 +1,43 @@
+#
+# 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 field in DagCode to MEDIUMTEXT for MySql
+
+Revision ID: e959f08ac86c
+Revises: 64a7d6477aae
+Create Date: 2020-12-07 16:31:43.982353
+
+"""
+from alembic import context, op
+from sqlalchemy.dialects import mysql
+
+# revision identifiers, used by Alembic.
+revision = 'e959f08ac86c'
+down_revision = '64a7d6477aae'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():  # noqa: D103
+    if context.config.get_main_option('sqlalchemy.url').startswith('mysql'):

Review comment:
       I think it's consistent, unless we want to change past migration, which I doubt.




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

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



[GitHub] [airflow] potiuk commented on a change in pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#discussion_r537882348



##########
File path: airflow/migrations/versions/4addfa1236f1_add_fractional_seconds_to_mysql_tables.py
##########
@@ -35,7 +35,7 @@
 
 
 def upgrade():  # noqa: D103
-    conn = op.get_bind()
+    conn = op.get_bind()  # pylint: disable=no-member

Review comment:
       Yeah . Another consistency change maybe ?




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

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