lh0156 opened a new pull request, #28450:
URL: https://github.com/apache/flink/pull/28450
## What is the purpose of the change
This pull request updates PyFlink's default Python executable from `python`
to `python3` on non-Windows environments.
PyFlink requires Python 3.9+, but `python` may resolve to Python 2 or may
not exist on systems where Python 3 is installed as `python3`. Using `python3`
as the default aligns the runtime defaults, shell script defaults, and
documentation with the supported Python versions.
## Brief change log
- Changed `python.executable` and `python.client.executable` defaults to
`python3`.
- Changed the default Python executable used by `PythonEnvUtils` on
non-Windows environments to `python3`.
- Updated PyFlink shell and UDF runner script defaults to use `python3`.
- Updated PyFlink installation and configuration docs to prefer `python3`.
- Added regression coverage for the default option values and
`PythonEnvUtils` default environment.
## Verifying this change
This change added tests and can be verified as follows:
- Added assertions in `PythonOptionsTest` for the default
`python.executable` and `python.client.executable` values.
- Updated `PythonEnvUtilsTest` to expect `python3` as the non-Windows
default executable while keeping the Windows default as `python.exe`.
- Ran `bash -n flink-python/bin/pyflink-shell.sh`.
- Ran `bash -n flink-python/pyflink/bin/pyflink-udf-runner.sh`.
- Ran `git diff --check`.
- Searched the touched PyFlink code, scripts, and docs to ensure stale
`python` defaults and Python 3.8 wording were not left behind.
I also attempted to run:
- `./mvnw -pl flink-python -am -Dtest=PythonEnvUtilsTest,PythonOptionsTest
-Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false -DskipITs -Dfast
test`
The local reactor build had to be stopped before reaching `flink-python`
because the machine had 249 MiB of free disk space remaining while Maven was
still compiling upstream reactor dependencies.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (Codex)
Generated-by: Codex (GPT-5)
--
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]