kir-rin commented on code in PR #67325:
URL: https://github.com/apache/airflow/pull/67325#discussion_r3288068433


##########
airflow-core/src/airflow/utils/file.py:
##########
@@ -76,7 +77,7 @@ def open_maybe_zipped(fileloc, mode="r"):
 
 def list_py_file_paths(
     directory: str | os.PathLike[str] | None,
-    safe_mode: bool = conf.getboolean("core", "DAG_DISCOVERY_SAFE_MODE", 
fallback=True),
+    safe_mode: bool | ArgNotSet = NOTSET,

Review Comment:
   NIT: `NOTSET` being in `serialization.definitions` feels a bit misplaced. 
   It's a general sentinel pattern used across multiple modules.
   
   <img width="656" height="308" alt="image" 
src="https://github.com/user-attachments/assets/21d39f96-f6f2-49e4-94a2-4526e1af25fd";
 />
   
   
   Since NOTSET is the only place that defines this sentinel and is imported 
from various modules, 
   moving it to a more general location (e.g., `shared/` or `airflow/utils/`) 
could help prevent 
   subtle bugs like the default argument evaluation issue fixed in this PR and 
make the dependency 
   structure more intuitive.



##########
airflow-core/src/airflow/utils/file.py:
##########
@@ -76,7 +77,7 @@ def open_maybe_zipped(fileloc, mode="r"):
 
 def list_py_file_paths(
     directory: str | os.PathLike[str] | None,
-    safe_mode: bool = conf.getboolean("core", "DAG_DISCOVERY_SAFE_MODE", 
fallback=True),
+    safe_mode: bool | ArgNotSet = NOTSET,

Review Comment:
   NIT: `NOTSET` being in `serialization.definitions` feels a bit misplaced. 
   It's a general sentinel pattern used across multiple modules.
   
   <img width="400" height="308" alt="image" 
src="https://github.com/user-attachments/assets/21d39f96-f6f2-49e4-94a2-4526e1af25fd";
 />
   
   
   Since NOTSET is the only place that defines this sentinel and is imported 
from various modules, 
   moving it to a more general location (e.g., `shared/` or `airflow/utils/`) 
could help prevent 
   subtle bugs like the default argument evaluation issue fixed in this PR and 
make the dependency 
   structure more intuitive.



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