-
Notifications
You must be signed in to change notification settings - Fork 17.3k
Removes limitations from Dask dependencies #22017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,31 +20,39 @@ | |||||
| from unittest import mock | ||||||
|
|
||||||
| import pytest | ||||||
| from distributed import LocalCluster | ||||||
|
|
||||||
| from airflow.exceptions import AirflowException | ||||||
| from airflow.executors.dask_executor import DaskExecutor | ||||||
| from airflow.jobs.backfill_job import BackfillJob | ||||||
| from airflow.models import DagBag | ||||||
| from airflow.utils import timezone | ||||||
| from tests.test_utils.config import conf_vars | ||||||
|
|
||||||
| try: | ||||||
| from distributed import LocalCluster | ||||||
|
|
||||||
| # utility functions imported from the dask testing suite to instantiate a test | ||||||
| # cluster for tls tests | ||||||
| from distributed import tests # noqa | ||||||
| from distributed.utils_test import cluster as dask_testing_cluster, get_cert, tls_security | ||||||
|
|
||||||
| from airflow.executors.dask_executor import DaskExecutor | ||||||
|
|
||||||
| skip_tls_tests = False | ||||||
| except ImportError: | ||||||
| skip_tls_tests = True | ||||||
| # In case the tests are skipped because of lacking test harness, get_cert should be | ||||||
| # overridden to avoid get_cert failing during test discovery as get_cert is used | ||||||
| # in conf_vars decorator | ||||||
| get_cert = lambda x: x | ||||||
|
|
||||||
| DEFAULT_DATE = timezone.datetime(2017, 1, 1) | ||||||
| SUCCESS_COMMAND = ['airflow', 'tasks', 'run', '--help'] | ||||||
| FAIL_COMMAND = ['airflow', 'tasks', 'run', 'false'] | ||||||
|
|
||||||
| # For now we are temporarily removing Dask support until we get Dask Team help us in making the | ||||||
| # tests pass again | ||||||
| skip_dask_tests = True | ||||||
|
|
||||||
|
|
||||||
| @pytest.mark.skipif(skip_dask_tests, reason="The tests are skipped because it needs testing from Dask team") | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wanted to give an easy way for Dask committers to be able to "play" with it. it's easier to set up one variable to True to do it, rather than manually remove @pytest.mark.skip for all test cases. This is really a "temporary" state I wanted to make easy for them to work on (same as last time).
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I imagine the Dask developers will do it this way:
By having single flag to switch that enables all tests it is just easier to not forget about removing some of the skips. |
||||||
| class TestBaseDask(unittest.TestCase): | ||||||
| def assert_tasks_on_executor(self, executor, timeout_executor=120): | ||||||
|
|
||||||
|
|
@@ -75,6 +83,7 @@ def assert_tasks_on_executor(self, executor, timeout_executor=120): | |||||
| assert fail_future.exception() is not None | ||||||
|
|
||||||
|
|
||||||
| @pytest.mark.skipif(skip_dask_tests, reason="The tests are skipped because it needs testing from Dask team") | ||||||
| class TestDaskExecutor(TestBaseDask): | ||||||
| def setUp(self): | ||||||
| self.dagbag = DagBag(include_examples=True) | ||||||
|
|
@@ -148,6 +157,7 @@ def test_gauge_executor_metrics(self, mock_stats_gauge, mock_trigger_tasks, mock | |||||
| mock_stats_gauge.assert_has_calls(calls) | ||||||
|
|
||||||
|
|
||||||
| @pytest.mark.skipif(skip_dask_tests, reason="The tests are skipped because it needs testing from Dask team") | ||||||
| class TestDaskExecutorQueue(unittest.TestCase): | ||||||
| def test_dask_queues_no_resources(self): | ||||||
| self.cluster = LocalCluster() | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@potiuk , Out of curiosity, is this strictly maintained by the Dask team, is this something I can take a look, I was looking also at options of connecting to a Local Dask cluster along with distributed.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not. I started discussion on that here https://lists.apache.org/thread/6stgcpjt5jb3xfw92oo1j486j33c8v7m
This is is a second time I start similar discussion - the previous time it was in Jan 2020 https://lists.apache.org/thread/875fpgb7vfpmtxrmt19jmo8d3p6mgqnh and then Dask team chimed in and helped in fixing the tests.
But more than 1 year later we have similar problem.
I also asked at Dask's disccoure whether they can help again: https://dask.discourse.group/t/potential-removal-of-dask-executor-support-in-airflow/433