-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Fix #[35617] Windows compatibility for YAML JavaJarProvider #35618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
|
why the number of changed files shows as 0 and my committed code seems to have disappeared. |
|
I'm not sure - this is quite confusing. It also says I merged your PR, but I did not see this PR until now... I did merge #35316 at the same time. Seems like maybe a github bug? This repo's main branch doesn't seem to have any changes similar to what I assume this PR added |
|
Hi, I guess there is some issue with this PR as there is no modification in apache_beam/yaml/yaml_provider.py. |
Yes, I think I need to try to resubmit the file |
|
It appears when someone merged a PR onto master branch, it will trigger close empty open PR. |
It seems that this is the case. My master branch automatically synchronized with the main warehouse, causing the code to be lost. I think I need to create another branch to merge pr, so that there should be no problem. |
Fix Windows compatibility for YAML JavaJarProvider
Description
This PR fixes a cross-platform compatibility issue in the YAML provider where the
JavaJarProvider.available()method fails on Windows systems due to the use of the Unix-specificwhichcommand.Problem
The original implementation uses
subprocess.run(['which', java_executable])which works on Unix/Linux systems but fails on Windows withFileNotFoundError: [WinError 2] The system cannot find the file specifiedbecause Windows doesn't have awhichcommand.Solution
platform.system()to detect the operating systemwherecommand on Windows instead ofwhichwhichcommand behavior unchangedshutil.which()as a cross-platform fallback for edge casesFileNotFoundErrorandOSErrorChanges Made
JavaJarProvider.available()method inapache_beam/yaml/yaml_provider.pywhereon Windows,whichon Unix/Linux) for Java detectionshutil.whichfallback for cross-platform compatibilityTesting
Backward Compatibility
boolorNotAvailableWithReasonCode Quality
Impact
This change enables Windows users to use Apache Beam's YAML functionality without requiring workarounds, manual patches, or Unix-like environments (WSL, Git Bash, etc.).
Before: Windows users encounter
FileNotFoundErrorwhen using YAML providersAfter: YAML providers work seamlessly across all supported platforms
CHANGES.mdwith noteworthy changes.Additional Notes