Skip to content

STYLE: use option_context almost always #38813

Closed
@jreback

Description

@jreback

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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions