-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Move core.config to _config.config #25793
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #25793 +/- ##
==========================================
+ Coverage 91.26% 91.26% +<.01%
==========================================
Files 173 174 +1
Lines 52982 52984 +2
==========================================
+ Hits 48355 48357 +2
Misses 4627 4627
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #25793 +/- ##
==========================================
+ Coverage 91.47% 91.47% +<.01%
==========================================
Files 172 173 +1
Lines 52870 52872 +2
==========================================
+ Hits 48362 48364 +2
Misses 4508 4508
Continue to review full report at Codecov.
|
|
Fixed |
can you rebase |
rebased+green |
pandas/_libs/tslibs/parsing.pyx
Outdated
@@ -30,6 +30,8 @@ from dateutil.relativedelta import relativedelta | |||
from dateutil.parser import DEFAULTPARSER | |||
from dateutil.parser import parse as du_parse | |||
|
|||
from pandas._config.config import get_option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than reaching in, I would expose get_options, and company in pandas._config (in the 'all')?
Hello @jbrockmendel! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-03-24 15:48:29 UTC |
pandas/__init__.py
Outdated
@@ -36,6 +36,9 @@ | |||
|
|||
from datetime import datetime | |||
|
|||
from pandas._config.config import (get_option, set_option, reset_option, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what I mean was to have all of these listed in the 'all' in pandas._config, then this can just be a * import and then you can always just from pandas._config import .....
rather than reaching into pandas._config.config
(I know there are some cases of that but can fix those in a follow). this would make clear then this modules public api.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Moved those into _config.__init__
. Will update all the other imports on the next pass. Will ignore the "*" import idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will ignore the "*" import idea.
we do this for all api imports in pandas/init.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs a rebase. pls try to normalize all of the imports to import from pandas if at all possible (which should be fore all except: import pandas._config.config as cf
which is used occasionally (want to clean those up too but can be a followup)
@@ -54,7 +54,7 @@ def test_format_sparse_display(): | |||
|
|||
|
|||
def test_repr_with_unicode_data(): | |||
with pd.core.config.option_context("display.encoding", 'UTF-8'): | |||
with pd._config.config.option_context("display.encoding", 'UTF-8'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you just import option_context at the top
pandas/tests/sparse/test_format.py
Outdated
@@ -3,10 +3,11 @@ | |||
|
|||
import numpy as np | |||
|
|||
from pandas._config.config import option_context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would prefer you import from pandas directly (and all cases where it is possible)
sorry, can you rebase again :< looks good otherwise. |
@@ -36,6 +36,9 @@ | |||
|
|||
from datetime import datetime | |||
|
|||
from pandas._config import (get_option, set_option, reset_option, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how did these get in here now? (Ithink it is explicit and ok), but just wondering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These used to be a "*" import, now made explicit.
thanks @jbrockmendel |
and update imports. Move
tests.test_config
totests.config.test_config
.Following this there will be one more follow-up that will 1) address the TODO in
tests.config.test_localization
, 2) fully disentangletslibs
from its dependency oncore
.