[AIRFLOW-5895] Move HDFS stuff from tests/core.py#6544
[AIRFLOW-5895] Move HDFS stuff from tests/core.py#6544mik-laj merged 4 commits intoapache:masterfrom
Conversation
|
Travis is sad here as well. I recommend to run pre-commit hooks every time @mik-laj |
|
@potiuk Every time I use pre-commit, it causes wrong file changes. I have to change them to make Travis happy. I do not know the reason for this problem, so I had to turn it off to be able to continue working on this project. @@ -41,6 +41,8 @@ from dateutil.relativedelta import relativedelta
from numpy.testing import assert_array_almost_equal
from pendulum import utcnow
+from tests.test_utils.config import conf_vars
+
from airflow import DAG, configuration, exceptions, jobs, models, settings, utils
from airflow.bin import cli
from airflow.configuration import AirflowConfigException, conf, run_command
@@ -62,7 +64,6 @@ from airflow.utils.dates import days_ago, infer_time_unit, round_time, scale_tim
from airflow.utils.state import State
from airflow.utils.timezone import datetime
from airflow.version import version
-from tests.test_utils.config import conf_vars |
|
I am sure it's not every time. It never ever happened to me. I am super surprised because exactly the same check is run on Travis as in your local environment. I suggest you enable it and let me know when it happens again. I am happy to take a look when it happens again and help to find the reason (if this is really so frequent). You are the only person I know who has this problem so it would be worth checking what's wrong in your setup and prevent it happening also for others. If you look now at Travis - there is an over-indent in test_hdfs which would have been detected locally if you have pre-commits enabled. That's the whole point of pre-commit. Re. Import above - can you please explain what was wrong? The change above is not pre-commit - but simply isort in the works. What's wrong about this? The isort sorting algorithm is such that the "airflow" (my) imports are always at the end. We all agreed we use isort so we should follow it. Or we can configure skip rules in setup.cfg Let me know if any of those help. And happy to help further. |
tests/sensors/test_hdfs_sensor.py
Outdated
There was a problem hiding this comment.
Maybe it's worth to consider to make tests.test_utils.mocks to keep there all fake / mock stuff?
There was a problem hiding this comment.
If there are a large number of them, we can create such a structure. Now it would only complicate the situation/import.
There was a problem hiding this comment.
If someone wants to add more things to HDFS then they will have ready place.
7041987 to
d2f1b64
Compare
Codecov Report
@@ Coverage Diff @@
## master #6544 +/- ##
=========================================
Coverage ? 83.28%
=========================================
Files ? 645
Lines ? 37286
Branches ? 0
=========================================
Hits ? 31052
Misses ? 6234
Partials ? 0Continue to review full report at Codecov.
|
|
@mik-laj -> happy we could solve your isort configuration (#6544 (comment)) - for anyone having similar problems and finding this thread : .isort.cfg in your home directory can override setting of setup.cfg [isort] section. |
Make sure you have checked all steps below.
Jira
Description
Tests
Commits
Documentation