JustinBinber opened a new pull request, #41562:
URL: https://github.com/apache/beam/pull/41562

   Fixes #41561.
   
   The local filesystem removes an existing destination before copying. When 
source and destination are the same object, including an equivalent path, this 
deletes the source and then raises `BeamIOError`. A missing source can also 
delete an existing destination.
   
   This checks `os.path.samefile` before removal and routes self-copy failures 
through the existing error aggregation. Missing sources fail during that check 
before destination removal. Normal overwrite and unrelated pairs in a batch 
retain their behavior. The change does not promise atomic copies or redesign 
ancestor/descendant directory handling.
   
   Added real filesystem coverage for files, nonempty directories, equivalent 
paths, hard links, public `FileSystems.copy` dispatch, missing-source 
destination preservation, normal overwrite and mixed batch errors. Added a 
noteworthy change to `CHANGES.md`.
   
   Validation:
   
   - Collected nine explicit offline regression cases before running them. 
Before the guard: **8 failed, 1 passed**, including source deletion; after: **9 
passed**.
   - `python -m pytest -q sdks/python/apache_beam/io/localfilesystem_test.py 
sdks/python/apache_beam/io/filesystem_test.py`: **79 passed**.
   - Configured pre-commit checks: pinned YAPF **0.43.0**, Ruff **0.15.7**; 
`git diff --check` passes.
   - Tested current master Python sources on Windows/Python **3.11.7**. 
Generated protobuf modules were supplied from the released **2.78.0** wheel in 
the ignored source API directory. Filesystem operations and public dispatch use 
current source without mocks; no cloud service, distributed runner or fresh SDK 
build was used.
   


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