Skip to content

GH-50957: [Python] Reject unexpected concat_tables keywords - #50959

Open
Sakshamm-Goyal wants to merge 1 commit into
apache:mainfrom
Sakshamm-Goyal:fix/concat-tables-unexpected-kwargs
Open

GH-50957: [Python] Reject unexpected concat_tables keywords#50959
Sakshamm-Goyal wants to merge 1 commit into
apache:mainfrom
Sakshamm-Goyal:fix/concat-tables-unexpected-kwargs

Conversation

@Sakshamm-Goyal

@Sakshamm-Goyal Sakshamm-Goyal commented Aug 23, 2026

Copy link
Copy Markdown

Rationale for this change

concat_tables() keeps **kwargs only for the deprecated promote argument, but previously discarded every other key. As a result, keyword typos and apparently meaningful inputs such as unify_schemas were silently accepted without affecting the result.

What changes are included in this PR?

  • Reject unsupported keyword arguments with TypeError before processing the deprecated compatibility argument.
  • Document that promote is the only accepted extra argument.
  • Add a focused regression for the reported unknown-key behavior.

Are these changes tested?

  • Built and installed the current Arrow C++ minimal Python preset and an editable PyArrow from this branch.
  • python -m pytest -q python/pyarrow/tests/test_table.py -k 'concat_tables': 9 passed.
  • python -m pytest -q python/pyarrow/tests/test_table.py: 181 passed, 33 skipped.
  • Changed-file Python pre-commit hooks: format, flake8, and Cython lint passed.
  • git diff --check passed.

Are there any user-facing changes?

Yes. Unknown concat_tables() keyword arguments now raise TypeError, matching normal Python call behavior. The deprecated promote=True and promote=False compatibility path remains unchanged.

AI assistance

I used an AI coding assistant to help investigate the root cause, draft the focused two-file patch, and run validation. I reviewed and understand every change and can own and debug it during review.

Closes #50957

@uros-b

uros-b commented Aug 24, 2026

Copy link
Copy Markdown
Member

LGTM!

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.

[Python] concat_tables silently ignores unrecognised keyword arguments, including unify_schemas

2 participants