Skip to content

DEPR: correct locations to access public json/parser objects in depr message #15909

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 2 commits into from
Apr 7, 2017

Conversation

jorisvandenbossche
Copy link
Member

Another one remaining is pd.parser.na_values

In [2]: pd.parser.na_values
/home/joris/miniconda3/envs/dev/bin/ipython:1: FutureWarning: pandas.parser.na_values is deprecated. 
Please use pandas.io.libparsers.na_values instead.
  #!/home/joris/miniconda3/envs/dev/bin/python
Out[2]: 
{numpy.bool_: 255,
 dtype('bool'): 255,
 numpy.uint64: 18446744073709551615,
 numpy.int64: -9223372036854775808,
 dtype('int16'): -32768,
 dtype('uint64'): 18446744073709551615,
 numpy.int8: -128,
 dtype('int32'): -2147483648,
 numpy.uint8: 255,
 dtype('int8'): -128,
 numpy.object_: nan,
 numpy.float64: nan,
 numpy.uint32: 4294967295,
 dtype('O'): nan,
 numpy.int32: -2147483648,
 dtype('uint32'): 4294967295,
 dtype('uint16'): 65535,
 dtype('uint8'): 255,
 dtype('int64'): -9223372036854775808,
 dtype('float64'): nan,
 numpy.uint16: 65535,
 numpy.int16: -32768}

I don't think we should refer to libparsers, but for now it is not imported in pandas.io.parsers as alternative. I could add it there, but the question is maybe whether this is actually useful for users? Maybe we should say that it will be removed without giving alternative?

@jorisvandenbossche jorisvandenbossche added the Deprecate Functionality to remove in pandas label Apr 5, 2017
@jorisvandenbossche jorisvandenbossche added this to the 0.20.0 milestone Apr 5, 2017
@codecov
Copy link

codecov bot commented Apr 5, 2017

Codecov Report

Merging #15909 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15909      +/-   ##
==========================================
+ Coverage   90.95%   90.96%   +<.01%     
==========================================
  Files         145      145              
  Lines       49535    49535              
==========================================
+ Hits        45057    45058       +1     
+ Misses       4478     4477       -1
Flag Coverage Δ
#multiple 88.72% <100%> (ø) ⬆️
#single 40.62% <100%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/__init__.py 92.68% <100%> (ø) ⬆️
pandas/core/common.py 91.03% <0%> (+0.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4e87ec...49d032b. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 5, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@88bed54). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #15909   +/-   ##
=========================================
  Coverage          ?   90.96%           
=========================================
  Files             ?      145           
  Lines             ?    49475           
  Branches          ?        0           
=========================================
  Hits              ?    45007           
  Misses            ?     4468           
  Partials          ?        0
Flag Coverage Δ
#multiple 88.72% <100%> (?)
#single 40.68% <100%> (?)
Impacted Files Coverage Δ
pandas/util/depr_module.py 80.48% <ø> (ø)
pandas/tslib.py 100% <ø> (ø)
pandas/__init__.py 92.68% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 88bed54...01f8c38. Read the comment docs.

@jreback
Copy link
Contributor

jreback commented Apr 5, 2017

hmm, I don't remember why I added compat for this. let me have a look.

@jreback
Copy link
Contributor

jreback commented Apr 6, 2017

yeah I think we should just remove na_values entirely. any objections? (as I said I don't remember why I had added this).

@jorisvandenbossche
Copy link
Member Author

I don't know why you would need na_values, so OK for me (@gfyoung ?)

@jorisvandenbossche jorisvandenbossche changed the title DEPR: correct locations to access public json objects in depr message DEPR: correct locations to access public json/parser objects in depr message Apr 7, 2017
@jorisvandenbossche
Copy link
Member Author

Added removal of na_values and correct redirect for CParserError

@@ -60,11 +60,15 @@
# extension module deprecations
from pandas.util.depr_module import _DeprecatedModule

json = _DeprecatedModule(deprmod='pandas.json', deprmodto='pandas.io.json.libjson')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might be able to remove the deprmodto argument entirely (which I added to handle moving modules).

@gfyoung
Copy link
Member

gfyoung commented Apr 7, 2017

@jorisvandenbossche :

I don't know why you would need na_values, so OK for me

Makes sense to me. Hopefully it doesn't break any tests.

@jorisvandenbossche
Copy link
Member Author

@gfyoung to be clear, it is not removed internally, only the public exposure is deprecated. So it is about whether external users would want to use it

@gfyoung
Copy link
Member

gfyoung commented Apr 7, 2017

@jorisvandenbossche :

to be clear, it is not removed internally

Yes, absolutely! I meant that hopefully no tests were accessing this variable externally.

@jreback
Copy link
Contributor

jreback commented Apr 7, 2017

ok, used the script to rebase you locally and push up. seemed to work.

@jreback jreback merged commit c4dca36 into pandas-dev:master Apr 7, 2017
@jreback
Copy link
Contributor

jreback commented Apr 7, 2017

thanks!

@jorisvandenbossche jorisvandenbossche deleted the depr-locations branch April 7, 2017 20:51
@jorisvandenbossche
Copy link
Member Author

ok, used the script to rebase you locally and push up. seemed to work.

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants