Skip to content

Conversation

@damccorm
Copy link
Contributor

@damccorm damccorm commented May 13, 2025

Today, you can abbreviate arguments in Beam. This is generally convenient since you can do things like specify --r instead of --runner, and Beam will infer your intent.

Unfortunately, it also has unintended side effects. For example, specifying --u will impact not just --update, but also --update_compatibility_version (caused bug fixed by #34083), and specifying --output like we do in most examples will impact --output_executable_path as well (notably, this cannot be fixed in an easy way like update_compatibility_version since both output and output_executable_path might be expecting strings). There is not an easy way to resolve this, and it only gets worse as we add more flags over time.

To resolve this, this PR makes a one time breaking change to get rid of argument abbreviation. This will cause existing pipelines which are using this feature to no longer pick up abbreviated flags. In most cases, this will lead to obvious changes in behavior or failures (e.g. a runner is not specified correctly and now tries to run with the local runner), but in some cases the issue may be more subtle. I do not think there is a great way around this.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@liferoad
Copy link
Contributor

Fixes #34101

# Build parser that will parse options recognized by the [sub]class of
# PipelineOptions whose object is being instantiated.
parser = _BeamArgumentParser()
parser = _BeamArgumentParser(allow_abbrev=False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we also checking documentation and test cases where the abbreviation is used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test cases are run as part of this PR. As far as I know, we do not use abbreviations in our docs

@damccorm damccorm linked an issue May 14, 2025 that may be closed by this pull request
17 tasks
Co-authored-by: tvalentyn <tvalentyn@users.noreply.github.com>
@damccorm damccorm marked this pull request as ready for review May 15, 2025 14:02
@damccorm damccorm merged commit f0c4f81 into master May 15, 2025
91 checks passed
@damccorm damccorm deleted the users/damccorm/abbreviation branch May 15, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Dataflow option validation fails in VSCode Jupyter notebook

4 participants