8000 DEPR: Deprecated passing arguments as positional in pd.concat by tegardp · Pull Request #41718 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

DEPR: Deprecated passing arguments as positional in pd.concat #41718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jun 7, 2021
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
catch warning message
  • Loading branch information
MarcoGorelli committed Jun 5, 2021
commit abe77dbe5c8f9f36cf8af3733b0f703840c779a6
9 changes: 7 additions & 2 deletions pandas/tests/reshape/concat/test_invalid.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ def test_concat_invalid(self):
def test_concat_invalid_first_argument(self):
df1 = tm.makeCustomDataframe(10, 2)
df2 = tm.makeCustomDataframe(10, 2)
msg = (
err_msg = (
"first argument must be an iterable of pandas "
'objects, you passed an object of type "DataFrame"'
)
with pytest.raises(TypeError, match=msg):
warn_msg = (
"In a future version of pandas all arguments of concat "
"except for the argument 'objs' will be keyword-only"
)
warning_ctx = tm.assert_produces_warning(FutureWarning, match=warn_msg)
with pytest.raises(TypeError, match=err_msg), warning_ctx:
Copy link
Member

Choose a reason for hiding this comment

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

when we deprecate, python will raise TypeError: concat() takes 1 positional argument but 2 were given before the function validates the first argument.

maybe concat(df1, df2) -> concat(df1)

concat(df1, df2)

# generator ok though
Expand Down
0