Copilot commented on code in PR #37025:
URL: https://github.com/apache/superset/pull/37025#discussion_r2678026863


##########
superset/extensions/local_extensions_watcher.py:
##########
@@ -46,6 +46,10 @@ def on_any_event(self, event: Any) -> None:
                 if event.is_directory:
                     return
 
+                # Only trigger on changes to files in dist/ directory
+                if "/dist/" not in event.src_path:

Review Comment:
   The path check using "/dist/" is not cross-platform compatible and will fail 
on Windows systems where paths use backslashes. Additionally, this substring 
check could incorrectly match files or directories containing "dist" in their 
name outside the actual dist directory (e.g., "/distributed/file.py"). Consider 
using os.path.sep to construct the path separator or using Path operations to 
check if "dist" is in the path components.
   ```suggestion
                   # Only trigger on changes to files in a dist directory 
(cross-platform)
                   src_path = Path(event.src_path)
                   if "dist" not in src_path.parts:
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to