Skip to content

fix type annotation for pandas._config.config.py #25918

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 4 commits into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ follow_imports=silent
[mypy-pandas.conftest,pandas.tests.*]
ignore_errors=True

[mypy-pandas._config.config]
ignore_errors=True

[mypy-pandas._version]
ignore_errors=True

Expand Down
16 changes: 12 additions & 4 deletions pandas/_config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,24 @@
from collections import namedtuple
from contextlib import contextmanager
import re
from typing import Dict, List
import warnings

DeprecatedOption = namedtuple('DeprecatedOption', 'key msg rkey removal_ver')
RegisteredOption = namedtuple('RegisteredOption',
'key defval doc validator cb')

_deprecated_options = {} # holds deprecated option metdata
_registered_options = {} # holds registered option metdata
_global_config = {} # holds the current values for registered options
_reserved_keys = ['all'] # keys which have a special meaning
# holds deprecated option metdata
_deprecated_options = {} # type: Dict[str, DeprecatedOption]

# holds registered option metdata
_registered_options = {} # type: Dict[str, RegisteredOption]

# holds the current values for registered options
_global_config = {} # type: Dict[str, str]

# keys which have a special meaning
_reserved_keys = ['all'] # type: List[str]


class OptionError(AttributeError, KeyError):
Expand Down