mik-laj commented on a change in pull request #16860:
URL: https://github.com/apache/airflow/pull/16860#discussion_r667314112
##########
File path: airflow/models/dag.py
##########
@@ -734,15 +759,22 @@ def task_group(self) -> "TaskGroup":
@property
def filepath(self) -> str:
- """File location of where the dag object is instantiated"""
- fn = self.full_filepath.replace(settings.DAGS_FOLDER + '/', '')
- fn = fn.replace(os.path.dirname(__file__) + '/', '')
+ """:meta private:"""
+ warnings.warn(
+ "filepath is deprecated, use relative_fileloc instead",
DeprecationWarning, stacklevel=2
+ )
+ return self.relative_fileloc
+
+ @property
+ def relative_fileloc(self) -> str:
+ """File location of the importable dag 'file' relative to the
configured DAGs folder."""
Review comment:
Maybe we are also able to handle examples DAGs by adding a suffix? This
will allow us to install workers on shared machines without any problems
For samples:
`[exaample_dags_folder]/example_bash_operator.py` =>
`/usr/lib/python3.7/.../airflow/example_dags/example_bash_operator.py`
`[dags_folder]/example_bash_operator.py` => `~/home/airflow/dags`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]