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 2021/03/20 12:22:24 UTC

[GitHub] [airflow] mcepok opened a new pull request #14913: Upgrade rule to suggest to rename max_threads to parsing_processes

mcepok opened a new pull request #14913:
URL: https://github.com/apache/airflow/pull/14913


   This adds an upgrade rule as described in #12672 to rename the max_threads configuration to parsing_processes.
   
   I created this rule on the example of the `LoggingConfigurationRule`, which doesn't suggest any changes if the old configuration exists but has the default value. I assume, that the idea behind this is, that if the configuration is not set by the user, a default configuration is taken. However, if a user explicitly copied the default configuration in his or her own configuration, in my opinion, a change should be suggested but isn't. But maybe I misunderstood something.


-- 
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] kaxil merged pull request #14913: Upgrade rule to suggest to rename max_threads to parsing_processes

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


   


-- 
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] mcepok commented on a change in pull request #14913: Upgrade rule to suggest to rename max_threads to parsing_processes

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



##########
File path: tests/upgrade/rules/test_parsing_processes_configuration_rule.py
##########
@@ -0,0 +1,61 @@
+# 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 unittest import TestCase
+
+from airflow.configuration import conf
+from airflow.upgrade.rules.parsing_processes_configuration_rule import ParsingProcessesConfigurationRule
+from tests.test_utils.config import conf_vars
+
+
+class TestParsingProcessesConfigurationRule(TestCase):
+    @conf_vars(
+        {
+            ("scheduler", "parsing_processes"): "DUMMY",
+        }
+    )
+    def test_check_new_config(self):
+        rule = ParsingProcessesConfigurationRule()
+
+        assert isinstance(rule.description, str)
+        assert isinstance(rule.title, str)
+
+        # Remove the fallback option
+        conf.deprecated_options.get("scheduler", {}).pop("parsing_processes", "")
+        conf.remove_option("scheduler", "parsing_processes")

Review comment:
       I see, thanks for the feedback. I adjusted the tests with mocks.




-- 
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] kaxil commented on a change in pull request #14913: Upgrade rule to suggest to rename max_threads to parsing_processes

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



##########
File path: tests/upgrade/rules/test_parsing_processes_configuration_rule.py
##########
@@ -0,0 +1,61 @@
+# 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 unittest import TestCase
+
+from airflow.configuration import conf
+from airflow.upgrade.rules.parsing_processes_configuration_rule import ParsingProcessesConfigurationRule
+from tests.test_utils.config import conf_vars
+
+
+class TestParsingProcessesConfigurationRule(TestCase):
+    @conf_vars(
+        {
+            ("scheduler", "parsing_processes"): "DUMMY",
+        }
+    )
+    def test_check_new_config(self):
+        rule = ParsingProcessesConfigurationRule()
+
+        assert isinstance(rule.description, str)
+        assert isinstance(rule.title, str)
+
+        # Remove the fallback option
+        conf.deprecated_options.get("scheduler", {}).pop("parsing_processes", "")
+        conf.remove_option("scheduler", "parsing_processes")

Review comment:
       Yeah we should not do this and mock it instead as it causes side effects and other tests are failing, example: https://github.com/apache/airflow/pull/14913/checks?check_run_id=2155532411#step:6:960




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