Skip to content

Fix Beam async hook launching pipelines through a shell - #72510

Open
r3wretrhy wants to merge 1 commit into
apache:mainfrom
r3wretrhy:fix-beam-async-no-shell
Open

r3wretrhy wants to merge 1 commit into
apache:mainfrom
r3wretrhy:fix-beam-async-no-shell

Conversation

@r3wretrhy

Copy link
Copy Markdown

BeamAsyncHook started pipeline processes by joining the argv list with POSIX shlex quoting and running the result through a shell. The sync hook already uses subprocess.Popen with shell=False and the original list. The async path could therefore split interpreter or pipeline paths that contain spaces, especially on Windows where POSIX quoting is not what the shell expects.

This runs _beam_version and run_beam_command_async with asyncio.create_subprocess_exec so each argument stays one argv entry. Missing interpreters still raise AirflowException. Tests assert exec is used (not shell) and that an argument containing spaces survives a live process.


Was generative AI tooling used to co-author this PR?
  • Yes (Grok)

Generated-by: Grok following the guidelines


  • Tests run locally: python verification of run_beam_command_async with a spaced argument, exec-vs-shell construction, and _beam_version error wrapping. Full provider suite via CI: providers/apache/beam/tests/unit/apache/beam/hooks/test_beam.py.

@boring-cyborg

boring-cyborg Bot commented Sep 4, 2026

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@potiuk

potiuk commented Sep 8, 2026

Copy link
Copy Markdown
Member

this must wait for #66952

@r3wretrhy
r3wretrhy force-pushed the fix-beam-async-no-shell branch from dff9c46 to 145d86c Compare September 9, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants