Skip to content

Fix process_subdir bug#941

Merged
mistercrunch merged 1 commit intoapache:masterfrom
Attsun1031:fix-process-subdir-bug
Feb 1, 2016
Merged

Fix process_subdir bug#941
mistercrunch merged 1 commit intoapache:masterfrom
Attsun1031:fix-process-subdir-bug

Conversation

@Attsun1031
Copy link
Contributor

If subdir parameter (airflow run command) contains DAGS_FOLDER and the subdir is relative path, cli.process_subdir failed to parse correclty, and could not find dag file.

For example, if DAGS_FOLDER is /var/lib/airflow and current directory is also /var/lib/airflow, DAGS_FOLDER/abc become /var/lib/airflow/var/lib/airflow/abc.

This is because os.path.abspath is called before replace DAGS_FOLDER palceholder.
https://github.com/airbnb/airflow/blob/master/airflow/models.py#L630

This bug is critical because TaskInstance.commad specify DAGS_FOLDER/{dag.filepath} as default suddir value.

@mistercrunch
Copy link
Member

Totally makes sense. I added the abspath to the line recently but didn't think about moving it after the DAG_FOLDER replacement. Good call.

mistercrunch added a commit that referenced this pull request Feb 1, 2016
@mistercrunch mistercrunch merged commit c8b67f2 into apache:master Feb 1, 2016
mobuchowski pushed a commit to mobuchowski/airflow that referenced this pull request Jan 4, 2022
…dulum versions (apache#941)

* Handling paths to files in older airflow versions and handling of pendulum older version

Signed-off-by: Walter Hernandez <walter.hernandezcruz@mishcon.com>

* Added specification of exception for import of Pendulum

Signed-off-by: Walter Hernandez <walter.hernandezcruz@mishcon.com>

Co-authored-by: Walter Hernandez <walter.hernandezcruz@mishcon.com>
Co-authored-by: Willy Lulciuc <willy@datakin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants