Skip to content
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

CLN: Replace confusing brackets with backticks #54091

Merged
merged 2 commits into from
Jul 12, 2023
Merged

CLN: Replace confusing brackets with backticks #54091

merged 2 commits into from
Jul 12, 2023

Conversation

beyarkay
Copy link
Contributor

There are some errors which read like:

only list-like objects are allowed to be passed to isin(), you
passed a [str]

(note how the type str is enclosed in square brackets)

This is potentially confusing, since some languages use notation like [TYPE] to denote a list of TYPE objects. So the user could read the error message saying they can't use [str], but intepret [str] to mean "a list of str objects".

This commit removes the possibility of confusion by using backticks instead of square brackets.

There are some errors which read like:

> only list-like objects are allowed to be passed to isin(), you
> passed a [str]

(note how the type `str` is enclosed in square brackets)

This is potentially confusing, since some languages use notation like
`[TYPE]` to denote a list of TYPE objects. So the user could read the
error message saying they can't use `[str]`, but intepret `[str]` to
mean "a list of str objects".

This commit removes the possibility of confusion by using backticks
instead of square brackets.
@beyarkay beyarkay changed the title Replace confusing brackets with backticks CLN: Replace confusing brackets with backticks Jul 11, 2023
@mroeschke mroeschke added the Error Reporting Incorrect or improved errors from pandas label Jul 12, 2023
@mroeschke mroeschke added this to the 2.1 milestone Jul 12, 2023
@mroeschke mroeschke merged commit 4d38764 into pandas-dev:main Jul 12, 2023
@mroeschke
Copy link
Member

Thanks @beyarkay

@beyarkay
Copy link
Contributor Author

Thanks for the review!

@beyarkay beyarkay deleted the confusing-brackets branch July 12, 2023 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants