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/09/21 12:52:42 UTC
[GitHub] [airflow] turbaszek opened a new pull request #11056: Add ImportChangesRule for upgrade check
turbaszek opened a new pull request #11056:
URL: https://github.com/apache/airflow/pull/11056
Adds new rule that will be run during airflow upgrade-check
and will look for old clasess and imports incompatible with
Airflow 2.0.
Related to #8765
---
**^ 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] turbaszek commented on a change in pull request #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #11056:
URL: https://github.com/apache/airflow/pull/11056#discussion_r495557082
##########
File path: airflow/upgrade/rules/import_changes.py
##########
@@ -0,0 +1,89 @@
+# 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 typing import NamedTuple, Optional, List
+
+from cached_property import cached_property
+
+from airflow import conf
+from airflow.upgrade.rules.base_rule import BaseRule
+from airflow.upgrade.rules.renamed_classes import ALL
+from airflow.utils.dag_processing import list_py_file_paths
+
+
+class ImportChange(
+ NamedTuple(
+ "ImportChange",
+ [("old_path", str), ("new_path", str), ("providers_package", Optional[None])],
+ )
+):
Review comment:
Yup, not a big fan of this but we this command has to work with 2.7
----------------------------------------------------------------
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] turbaszek commented on pull request #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
turbaszek commented on pull request #11056:
URL: https://github.com/apache/airflow/pull/11056#issuecomment-696414868
Depends on #11066
----------------------------------------------------------------
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 #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #11056:
URL: https://github.com/apache/airflow/pull/11056#discussion_r494617052
##########
File path: airflow/upgrade/rules/import_changes.py
##########
@@ -0,0 +1,89 @@
+# 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 typing import NamedTuple, Optional, List
+
+from cached_property import cached_property
+
+from airflow import conf
+from airflow.upgrade.rules.base_rule import BaseRule
+from airflow.upgrade.rules.renamed_classes import ALL
+from airflow.utils.dag_processing import list_py_file_paths
+
+
+class ImportChange(
+ NamedTuple(
+ "ImportChange",
+ [("old_path", str), ("new_path", str), ("providers_package", Optional[None])],
+ )
+):
Review comment:
oh wait, I know why you did this, for compatibility with Py 2.7 , Py 3.5 ?
----------------------------------------------------------------
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] turbaszek commented on pull request #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
turbaszek commented on pull request #11056:
URL: https://github.com/apache/airflow/pull/11056#issuecomment-698365840
The docs faliure was already fixed.
----------------------------------------------------------------
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] turbaszek commented on pull request #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
turbaszek commented on pull request #11056:
URL: https://github.com/apache/airflow/pull/11056#issuecomment-698365840
----------------------------------------------------------------
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 #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #11056:
URL: https://github.com/apache/airflow/pull/11056#discussion_r494616612
##########
File path: airflow/upgrade/rules/import_changes.py
##########
@@ -0,0 +1,89 @@
+# 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 typing import NamedTuple, Optional, List
+
+from cached_property import cached_property
+
+from airflow import conf
+from airflow.upgrade.rules.base_rule import BaseRule
+from airflow.upgrade.rules.renamed_classes import ALL
+from airflow.utils.dag_processing import list_py_file_paths
+
+
+class ImportChange(
+ NamedTuple(
+ "ImportChange",
+ [("old_path", str), ("new_path", str), ("providers_package", Optional[None])],
+ )
+):
Review comment:
can be simplified
```suggestion
class ImportChange(NamedTuple)
old_path: str
new_path: str
providers_package: Optional[None]
```
----------------------------------------------------------------
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] turbaszek commented on pull request #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
turbaszek commented on pull request #11056:
URL: https://github.com/apache/airflow/pull/11056#issuecomment-698366049
@olchas @mik-laj @TobKed can you please take a look?
----------------------------------------------------------------
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] turbaszek commented on pull request #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
turbaszek commented on pull request #11056:
URL: https://github.com/apache/airflow/pull/11056#issuecomment-696268841
----------------------------------------------------------------
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 #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #11056:
URL: https://github.com/apache/airflow/pull/11056#discussion_r494617052
##########
File path: airflow/upgrade/rules/import_changes.py
##########
@@ -0,0 +1,89 @@
+# 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 typing import NamedTuple, Optional, List
+
+from cached_property import cached_property
+
+from airflow import conf
+from airflow.upgrade.rules.base_rule import BaseRule
+from airflow.upgrade.rules.renamed_classes import ALL
+from airflow.utils.dag_processing import list_py_file_paths
+
+
+class ImportChange(
+ NamedTuple(
+ "ImportChange",
+ [("old_path", str), ("new_path", str), ("providers_package", Optional[None])],
+ )
+):
Review comment:
oh wait, I know why you did this, for compatibility with Py 2.7 ?
----------------------------------------------------------------
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] turbaszek commented on pull request #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
turbaszek commented on pull request #11056:
URL: https://github.com/apache/airflow/pull/11056#issuecomment-696414868
Depends on #11066
----------------------------------------------------------------
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] turbaszek commented on pull request #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
turbaszek commented on pull request #11056:
URL: https://github.com/apache/airflow/pull/11056#issuecomment-696268841
cc @vikramkoka
----------------------------------------------------------------
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] JeffryMAC commented on a change in pull request #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
JeffryMAC commented on a change in pull request #11056:
URL: https://github.com/apache/airflow/pull/11056#discussion_r495564011
##########
File path: airflow/upgrade/rules/import_changes.py
##########
@@ -0,0 +1,89 @@
+# 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 typing import NamedTuple, Optional, List
+
+from cached_property import cached_property
+
+from airflow import conf
+from airflow.upgrade.rules.base_rule import BaseRule
+from airflow.upgrade.rules.renamed_classes import ALL
+from airflow.utils.dag_processing import list_py_file_paths
+
+
+class ImportChange(
+ NamedTuple(
+ "ImportChange",
+ [("old_path", str), ("new_path", str), ("providers_package", Optional[None])],
+ )
+):
Review comment:
Some operators did the other way.. from providers to core
https://github.com/apache/airflow/pull/10013
this message will be wrong for it?
----------------------------------------------------------------
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 #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #11056:
URL: https://github.com/apache/airflow/pull/11056#discussion_r494616612
##########
File path: airflow/upgrade/rules/import_changes.py
##########
@@ -0,0 +1,89 @@
+# 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 typing import NamedTuple, Optional, List
+
+from cached_property import cached_property
+
+from airflow import conf
+from airflow.upgrade.rules.base_rule import BaseRule
+from airflow.upgrade.rules.renamed_classes import ALL
+from airflow.utils.dag_processing import list_py_file_paths
+
+
+class ImportChange(
+ NamedTuple(
+ "ImportChange",
+ [("old_path", str), ("new_path", str), ("providers_package", Optional[None])],
+ )
+):
Review comment:
can be simplified
```suggestion
class ImportChange(NamedTuple)
old_path: str
new_path: str
providers_package: Optional[None]
```
##########
File path: airflow/upgrade/rules/import_changes.py
##########
@@ -0,0 +1,89 @@
+# 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 typing import NamedTuple, Optional, List
+
+from cached_property import cached_property
+
+from airflow import conf
+from airflow.upgrade.rules.base_rule import BaseRule
+from airflow.upgrade.rules.renamed_classes import ALL
+from airflow.utils.dag_processing import list_py_file_paths
+
+
+class ImportChange(
+ NamedTuple(
+ "ImportChange",
+ [("old_path", str), ("new_path", str), ("providers_package", Optional[None])],
+ )
+):
Review comment:
oh wait, I know why you did this, for compatibility with Py 2.7 ?
##########
File path: airflow/upgrade/rules/import_changes.py
##########
@@ -0,0 +1,89 @@
+# 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 typing import NamedTuple, Optional, List
+
+from cached_property import cached_property
+
+from airflow import conf
+from airflow.upgrade.rules.base_rule import BaseRule
+from airflow.upgrade.rules.renamed_classes import ALL
+from airflow.utils.dag_processing import list_py_file_paths
+
+
+class ImportChange(
+ NamedTuple(
+ "ImportChange",
+ [("old_path", str), ("new_path", str), ("providers_package", Optional[None])],
+ )
+):
Review comment:
oh wait, I know why you did this, for compatibility with Py 2.7 , Py 3.5 ?
----------------------------------------------------------------
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] turbaszek commented on a change in pull request #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #11056:
URL: https://github.com/apache/airflow/pull/11056#discussion_r495567845
##########
File path: airflow/upgrade/rules/import_changes.py
##########
@@ -0,0 +1,89 @@
+# 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 typing import NamedTuple, Optional, List
+
+from cached_property import cached_property
+
+from airflow import conf
+from airflow.upgrade.rules.base_rule import BaseRule
+from airflow.upgrade.rules.renamed_classes import ALL
+from airflow.utils.dag_processing import list_py_file_paths
+
+
+class ImportChange(
+ NamedTuple(
+ "ImportChange",
+ [("old_path", str), ("new_path", str), ("providers_package", Optional[None])],
+ )
+):
Review comment:
The message will be:
> Using `airflow.operators.email_operator.EmailOperator` will be replaced by `airflow.operators.email.EmailOperator`.
And I see no place for confusion here
----------------------------------------------------------------
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] turbaszek merged pull request #11056: Add ImportChangesRule for upgrade check
Posted by GitBox <gi...@apache.org>.
turbaszek merged pull request #11056:
URL: https://github.com/apache/airflow/pull/11056
----------------------------------------------------------------
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