ToxaZ opened a new issue #9373:
URL: https://github.com/apache/airflow/issues/9373


   **Apache Airflow version**: 1.10.10
   
   **What happened**:
   
   ```python
   maintenance_operator = PostgresOperator(
           task_id='get_tables_size',
           postgres_conn_id='pentaho',
           sql='./dags/maintenance/queries/get_tables_size.sql')
   ```
   brings an error
   `jinja2.exceptions.TemplateNotFound: 
./dags/maintenance/queries/get_tables_size.sql`
   
   **What you expected to happen**:
   
   PostgresOperator not parsing path to file. Instead tries to evaluate path 
string as sql query string.
   The only way to make it work now:
   
   ```python
   maintenance_operator = PostgresOperator(
           task_id='get_tables_size',
           postgres_conn_id='pentaho',
           sql=open(
               './dags/pentaho_maintenance/queries/get_tables_size.sql')
               .read())
   ```
   
   **Anything else we need to know**:
   
   Properly worked on airflow 1.10.2


----------------------------------------------------------------
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:
[email protected]


Reply via email to