1

I would like to import some python files as dependency in airflow and use an function in python_callable in PythonOperator. I tried placing the dependency python file in the dags folder, but doesn't seem to work. I'm assuming the DAG is being moved to some other folder, before being executed. Help appreciated!!

1
  • It should work, the dag folder in most cases are: ~/airflow/dags if you did not change the configuration. Commented Sep 11, 2017 at 15:37

1 Answer 1

3

Get an idea about your environment variable "AIRFLOW_HOME". If it is not declared, it points to your home directory by default. In airflow, the Python scripts are normally placed at "AIRFLOW_HOME"/airflow/dags You can place the Python script and it's dependencies there but I strongly recommend to create and package for the dependencies and install it in your Python environment along airflow and avoid the unnecessary clutter of files in your dag folders.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.