potiuk commented on code in PR #30104:
URL: https://github.com/apache/airflow/pull/30104#discussion_r1138294437


##########
airflow/utils/file.py:
##########
@@ -335,7 +335,23 @@ def find_dag_file_paths(directory: str | pathlib.Path, 
safe_mode: bool) -> list[
 COMMENT_PATTERN = re.compile(r"\s*#.*")
 
 
-def might_contain_dag(file_path: str, safe_mode: bool, zip_file: 
zipfile.ZipFile | None = None):
+def might_contain_dag(file_path: str, safe_mode: bool, zip_file: 
zipfile.ZipFile | None = None) -> bool:

Review Comment:
   I think safe_mode is not needed. IMHO this check if should be done before 
running callable.
   
   As it is now - every callable should start with:
   
   ```
       if not safe_mode:
           return True
   ```
   
   And we should do it always, even before importing the callable.



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

Reply via email to