Skip to content

STYLE: use option_context almost always #38813

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

Closed
jreback opened this issue Dec 30, 2020 · 8 comments · Fixed by #45407
Closed

STYLE: use option_context almost always #38813

jreback opened this issue Dec 30, 2020 · 8 comments · Fixed by #45407
Assignees
Labels
Code Style Code style, linting, code_checks good first issue
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Dec 30, 2020

we should very rarely be setting / getting options (except to test that functionaily explicity), and instead use pd.option_context, e.g. this should be changed:

https://github.com/pandas-dev/pandas/pull/31569/files#diff-5974844fa02c9b81f3477198023bd02503bf82da1e3d15df6dfd62cdca48666bR242

pandas/tests/io/formats/test_format.py is a hotbed for incorrect usages like this.

it may be possible to add a pre-commit hook to check for this in all but a small handful of files.

@jreback jreback added Code Style Code style, linting, code_checks good first issue labels Dec 30, 2020
@jreback jreback added this to the Contributions Welcome milestone Dec 30, 2020
@ssooffiiaannee
Copy link

I would like to work on this issue, would it be possible?

@1nF0rmed
Copy link
Contributor

I would like to work on this issue, would it be possible?

You can use the take chat command to self-assign an issue

@ssooffiiaannee ssooffiiaannee removed their assignment Dec 31, 2020
@ssooffiiaannee
Copy link

I'm sorry, I accidentally unassigned myself, could you assign me again?, I don't understand what you mean by the take chat command, I don't have the permission to assign myself an issue, do I?

@1nF0rmed
Copy link
Contributor

@ssooffiiaannee You can comment take it'll be assigned to you. I'm not a maintainer so I won't be able to assign you.

@n-mathis
Copy link

n-mathis commented Jan 8, 2021

take

@Opher-Lubzens
Copy link

take

@debnathshoham
Copy link
Member

take

@chrismoradi
Copy link
Contributor

take

chrismoradi added a commit to chrismoradi/pandas that referenced this issue Jan 17, 2022
Replaces `set_option` except when this function is directly tested.

Closes: pandas-dev#38813
@jreback jreback modified the milestones: Contributions Welcome, 1.5 Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment