BUG: Return a copy from single-table vstack#20097
Draft
nomad3 wants to merge 2 commits into
astropy:mainastropy/astropy:mainfrom
nomad3:fix-18910-copy-single-vstacknomad3/astropy:fix-18910-copy-single-vstackCopy head branch name to clipboard
Draft
BUG: Return a copy from single-table vstack#20097nomad3 wants to merge 2 commits intoastropy:mainastropy/astropy:mainfrom nomad3:fix-18910-copy-single-vstacknomad3/astropy:fix-18910-copy-single-vstackCopy head branch name to clipboard
nomad3 wants to merge 2 commits into
astropy:mainastropy/astropy:mainfrom
nomad3:fix-18910-copy-single-vstacknomad3/astropy:fix-18910-copy-single-vstackCopy head branch name to clipboard
Conversation
Contributor
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
Signed-off-by: Simon Aguilera <saguilera1608@gmail.com>
Signed-off-by: Simon Aguilera <saguilera1608@gmail.com>
nomad3
force-pushed
the
fix-18910-copy-single-vstack
branch
from
July 27, 2026 03:58
ecb197b to
631b048
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This changes the single-table fast path in
vstackto return a normal table copy instead of the input object itself. That makes the implementation match the documented new-table contract and prevents mutations to the result from silently changing the input.The regression test covers
TableandQTable, both as a direct input and a one-item list, and verifies class/value preservation plus independent data and metadata.This targets
mainonly; no behavioral backport is requested.Fixes #18910
Tests
pytest astropy/table/tests/test_operations.py— 238 passed, 8 skipped, 11 xfailedpytest astropy/table/tests— 2382 passed, 183 skipped, 14 xfailedruff check astropy/table/operations.py astropy/table/tests/test_operations.pyruff format --check astropy/table/operations.py astropy/table/tests/test_operations.py