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/31 13:00:29 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #15110: Use pathlib.Path for building paths in testfile

uranusjr commented on a change in pull request #15110:
URL: https://github.com/apache/airflow/pull/15110#discussion_r604875027



##########
File path: tests/utils/test_dag_processing.py
##########
@@ -50,7 +51,7 @@
 from tests.test_utils.config import conf_vars
 from tests.test_utils.db import clear_db_dags, clear_db_runs, clear_db_serialized_dags
 
-TEST_DAG_FOLDER = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, 'dags')
+TEST_DAG_FOLDER = pathlib.Path(__file__).parent.parent / 'dags'

Review comment:
       I wonder if it’d be easier to make `DagBag` accept `Union[Path, str, None]` instead and do the `str()` there. Persuambly `pathlib` would get more use as the main code base progresses as well?




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