uranusjr commented on a change in pull request #21538:
URL: https://github.com/apache/airflow/pull/21538#discussion_r805299701
##########
File path: airflow/models/dagbag.py
##########
@@ -284,7 +284,10 @@ def process_file(self, filepath, only_if_updated=True,
safe_mode=True):
self.log.exception(e)
return []
- if not zipfile.is_zipfile(filepath):
+ _, file_ext = os.path.splitext(os.path.split(filepath)[-1])
+ is_zipfile = file_ext != '.py' and zipfile.is_zipfile(filepath)
+
+ if not is_zipfile:
Review comment:
If you don’t need the first part of the filename, it’s easier (and
actually faster) to simply
```python
if not filepath.endswith(".py") and zipfile.is_zipfile(filepath):
```
--
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]