madison-ookla opened a new issue #13349:
URL: https://github.com/apache/airflow/issues/13349


   **Apache Airflow version**: 1.10.14
   
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl version`):
   
   **Environment**:
   
   - **Cloud provider or hardware configuration**: X
   - **OS** (e.g. from /etc/os-release): X
   - **Kernel** (e.g. `uname -a`): X
   - **Install tools**: X
   - **Others**: X
   
   **What happened**:
   
   The `AirflowMacroPluginRemovedRule` seems unable to process non-standard 
python files (e.g. `.xlsx`) and chokes out with an unhelpful error message.:
   
   ```python
   
==========================================================================================================================================================
 STATUS 
==========================================================================================================================================================
   
   Check for latest versions of apache-airflow and 
checker...........................................................................................................................................................................................................................................................SUCCESS
   Traceback (most recent call last):
     File "/Users/madison/programs/anaconda3/envs/memphis-airflow/bin/airflow", 
line 37, in <module>
       args.func(args)
     File 
"/Users/madison/programs/anaconda3/envs/memphis-airflow/lib/python3.8/site-packages/airflow/upgrade/checker.py",
 line 88, in run
       all_problems = check_upgrade(formatter, rules)
     File 
"/Users/madison/programs/anaconda3/envs/memphis-airflow/lib/python3.8/site-packages/airflow/upgrade/checker.py",
 line 37, in check_upgrade
       rule_status = RuleStatus.from_rule(rule)
     File 
"/Users/madison/programs/anaconda3/envs/memphis-airflow/lib/python3.8/site-packages/airflow/upgrade/problem.py",
 line 44, in from_rule
       result = rule.check()
     File 
"/Users/madison/programs/anaconda3/envs/memphis-airflow/lib/python3.8/site-packages/airflow/upgrade/rules/airflow_macro_plugin_removed.py",
 line 52, in check
       problems.extend(self._check_file(file_path))
     File 
"/Users/madison/programs/anaconda3/envs/memphis-airflow/lib/python3.8/site-packages/airflow/upgrade/rules/airflow_macro_plugin_removed.py",
 line 42, in _check_file
       for line_number, line in enumerate(file_pointer, 1):
     File 
"/Users/madison/programs/anaconda3/envs/memphis-airflow/lib/python3.8/codecs.py",
 line 322, in decode
       (result, consumed) = self._buffer_decode(data, self.errors, final)
   UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 16: 
invalid start byte
   ```
   
   **What you expected to happen**:
   
   I expected the macro to skip over files it could not process/understand
   
   **How to reproduce it**:
   
   Add an `.xlsx` or other binary document to the DAGs folder and run the 
upgrade check.
   
   
   **Suggested resolution**:
   
   I think it's fine to fail out on these files (it led us to add certain items 
to the `.airflowignore` which should have been there anyway) but I had to 
modify the upgrade rule directly to tell me _which_ files were the problem. A 
more helpful error message here, and possibly a message prompting users to add 
said files to their `.airflowignore` would be ideal.
   


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