You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Taragolis (via GitHub)" <gi...@apache.org> on 2024/02/20 11:35:56 UTC
[PR] Allow to skip `test_should_be_importable` if optional dependency not installed [airflow]
Taragolis opened a new pull request, #37558:
URL: https://github.com/apache/airflow/pull/37558
<!--
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.
-->
<!--
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 an 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/
-->
<!-- Please keep an empty line above the dashes. -->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+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 a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Allow to skip `test_should_be_importable` if optional dependency not installed [airflow]
Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis closed pull request #37558: Allow to skip `test_should_be_importable` if optional dependency not installed
URL: https://github.com/apache/airflow/pull/37558
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Allow to skip `test_should_be_importable` if optional dependency not installed [airflow]
Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #37558:
URL: https://github.com/apache/airflow/pull/37558#discussion_r1495720948
##########
tests/always/test_example_dags.py:
##########
@@ -36,6 +44,29 @@
"The test is skipped because we are running in limited Pydantic environment", allow_module_level=True
)
+# Some certain of examples/system tests might require additional dependencies,
+# which are not installed into specific CI check
+# Format of dictionary:
+# key: prefix of the file which need to be excluded,
+# values: dictionary with package distributions and optional specifier, e.g. >=2.3.4
+OPTIONAL_PROVIDERS_DEPENDENCIES: dict[str, dict[str, str | None]] = {
+ # Regression of https://github.com/apache/airflow/pull/37524
+ # It loads the module now eagerly instead of lazily
+ "tests/system/providers/common/io/example_file_transfer_local_to_s3.py": {"s3fs": None}
Review Comment:
Seems like it might be a quick fix
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Allow to skip `test_should_be_importable` if optional dependency not installed [airflow]
Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #37558:
URL: https://github.com/apache/airflow/pull/37558#discussion_r1495722115
##########
tests/always/test_example_dags.py:
##########
@@ -36,6 +44,29 @@
"The test is skipped because we are running in limited Pydantic environment", allow_module_level=True
)
+# Some certain of examples/system tests might require additional dependencies,
+# which are not installed into specific CI check
+# Format of dictionary:
+# key: prefix of the file which need to be excluded,
+# values: dictionary with package distributions and optional specifier, e.g. >=2.3.4
+OPTIONAL_PROVIDERS_DEPENDENCIES: dict[str, dict[str, str | None]] = {
+ # Regression of https://github.com/apache/airflow/pull/37524
+ # It loads the module now eagerly instead of lazily
+ "tests/system/providers/common/io/example_file_transfer_local_to_s3.py": {"s3fs": None}
Review Comment:
https://github.com/apache/airflow/pull/37559
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Allow to skip `test_should_be_importable` if optional dependency not installed [airflow]
Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #37558:
URL: https://github.com/apache/airflow/pull/37558#discussion_r1495763609
##########
tests/always/test_example_dags.py:
##########
@@ -36,6 +44,29 @@
"The test is skipped because we are running in limited Pydantic environment", allow_module_level=True
)
+# Some certain of examples/system tests might require additional dependencies,
+# which are not installed into specific CI check
+# Format of dictionary:
+# key: prefix of the file which need to be excluded,
+# values: dictionary with package distributions and optional specifier, e.g. >=2.3.4
+OPTIONAL_PROVIDERS_DEPENDENCIES: dict[str, dict[str, str | None]] = {
+ # Regression of https://github.com/apache/airflow/pull/37524
+ # It loads the module now eagerly instead of lazily
+ "tests/system/providers/common/io/example_file_transfer_local_to_s3.py": {"s3fs": None}
Review Comment:
But yeah. This fix either not work well. It fix on one case, but not in the others
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Allow to skip `test_should_be_importable` if optional dependency not installed [airflow]
Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #37558:
URL: https://github.com/apache/airflow/pull/37558#discussion_r1495680133
##########
airflow/providers/amazon/aws/fs/s3.py:
##########
@@ -49,7 +50,7 @@ def get_fs(conn_id: str | None, storage_options: dict[str, str] | None = None) -
try:
from s3fs import S3FileSystem
except ImportError:
- raise ImportError(
+ raise AirflowOptionalProviderFeatureException(
Review Comment:
This change not related and could be done by the separate PR. I will revert it back
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Allow to skip `test_should_be_importable` if optional dependency not installed [airflow]
Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #37558:
URL: https://github.com/apache/airflow/pull/37558#discussion_r1495716325
##########
tests/always/test_example_dags.py:
##########
@@ -36,6 +44,29 @@
"The test is skipped because we are running in limited Pydantic environment", allow_module_level=True
)
+# Some certain of examples/system tests might require additional dependencies,
+# which are not installed into specific CI check
+# Format of dictionary:
+# key: prefix of the file which need to be excluded,
+# values: dictionary with package distributions and optional specifier, e.g. >=2.3.4
+OPTIONAL_PROVIDERS_DEPENDENCIES: dict[str, dict[str, str | None]] = {
+ # Regression of https://github.com/apache/airflow/pull/37524
+ # It loads the module now eagerly instead of lazily
+ "tests/system/providers/common/io/example_file_transfer_local_to_s3.py": {"s3fs": None}
Review Comment:
I'm think it depend on how does it long takes to fix it.
If we think that it could be fixed soon, than we fix it first and after that made appropriate changes
If do not know how long does it take we have a to option
Option 1: Revert https://github.com/apache/airflow/pull/37524, otherwise we would have an error in the other tests
Option 2: Hide issue (merge this PR as is), create a task and remove it during the fixing
WDYT?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Allow to skip `test_should_be_importable` if optional dependency not installed [airflow]
Posted by "bolkedebruin (via GitHub)" <gi...@apache.org>.
bolkedebruin commented on code in PR #37558:
URL: https://github.com/apache/airflow/pull/37558#discussion_r1495707790
##########
tests/always/test_example_dags.py:
##########
@@ -36,6 +44,29 @@
"The test is skipped because we are running in limited Pydantic environment", allow_module_level=True
)
+# Some certain of examples/system tests might require additional dependencies,
+# which are not installed into specific CI check
+# Format of dictionary:
+# key: prefix of the file which need to be excluded,
+# values: dictionary with package distributions and optional specifier, e.g. >=2.3.4
+OPTIONAL_PROVIDERS_DEPENDENCIES: dict[str, dict[str, str | None]] = {
+ # Regression of https://github.com/apache/airflow/pull/37524
+ # It loads the module now eagerly instead of lazily
+ "tests/system/providers/common/io/example_file_transfer_local_to_s3.py": {"s3fs": None}
Review Comment:
Let's no do this. This one hides the issue
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Allow to skip `test_should_be_importable` if optional dependency not installed [airflow]
Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on PR #37558:
URL: https://github.com/apache/airflow/pull/37558#issuecomment-1954928711
Ok, let close it for now
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org