Skip to content

TST: added test for to_string when max_rows is zero (GH35394) #43300

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 2 commits into from
Sep 1, 2021

Conversation

lorenzophys
Copy link
Contributor

Provided tests for to_string when max_rows=0.

Tests and linter pass locally.

@alimcmaster1 alimcmaster1 added Testing pandas testing functions or related to the test suite Output-Formatting __repr__ of pandas objects, to_string labels Aug 31, 2021
@alimcmaster1 alimcmaster1 added this to the 1.4 milestone Aug 31, 2021
def test_to_string_max_rows_zero(data, expected):
# GH35394
result = DataFrame(data=data).to_string(max_rows=0)

Copy link
Member

Choose a reason for hiding this comment

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

Can remove this blank line

Copy link
Member

@alimcmaster1 alimcmaster1 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Minor comments

" col1 col2\n0 1 3\n1 2 4",
),
(
{"col1": [0, 2, 4], "col2": [3, 4, 5]},
Copy link
Member

Choose a reason for hiding this comment

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

This test case seems pretty similar to the first is it really needed?

@lorenzophys
Copy link
Contributor Author

Thanks for the review @alimcmaster1

@alimcmaster1
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@alimcmaster1 alimcmaster1 left a comment

Choose a reason for hiding this comment

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

Looks okay to me.

@jreback jreback merged commit 17d5d99 into pandas-dev:master Sep 1, 2021
@jreback
Copy link
Contributor

jreback commented Sep 1, 2021

thanks @lorenzophys

feefladder pushed a commit to feefladder/pandas that referenced this pull request Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Output-Formatting __repr__ of pandas objects, to_string Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: UnboundLocalError on df.to_string(max_rows=0)
3 participants