uranusjr commented on code in PR #73118:
URL: https://github.com/apache/airflow/pull/73118#discussion_r4024202933


##########
task-sdk/src/airflow/sdk/importers/base.py:
##########
@@ -234,9 +239,17 @@ def get_file_suffix(definition: DagDefinition | str | 
Path) -> str | None:
 def find_file_dag_definitions(
     bundle_path: Path,
     supported_extensions: Iterable[str],
-    safe_mode: bool = True,
-) -> Iterator[DagDefinition]:
-    """Find file DAG definitions in a bundle matching given extensions and 
respecting .airflowignore."""
+) -> Iterator[FileDagDefinition]:
+    """
+    Discover file DAG definitions in a bundle by *identity* alone.
+
+    This walk decides purely from the file's name and path -- extension, 
``.airflowignore``,
+    and the Python source/bytecode pairing -- and never reads a file's 
contents. Deciding
+    whether a discovered file actually contains a DAG is content-based work 
that belongs to

Review Comment:
   I moved the sniffing back to the discovery phase (`list_dag_definitions`) to 
match the in-use implementation. The sniffing logic would not be as useful in 
non-Python formats, so we probably need some additional work around it when we 
reach that part, but at least we should keep the Python file behavior not too 
different, at least for now.



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