Skip to content
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

Lock down kwargs in offsets signatures #17458

Merged
merged 22 commits into from
Oct 6, 2017
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5e276c9
Lock down kwargs in offsets signatures
jbrockmendel Sep 7, 2017
0183e50
whatsnew note
jbrockmendel Sep 7, 2017
e33626e
Merge branch 'master' of https://github.com/pandas-dev/pandas into of…
jbrockmendel Sep 8, 2017
1377df1
Merge branch 'master' of https://github.com/pandas-dev/pandas into of…
jbrockmendel Sep 24, 2017
ed78a4a
restrict YearOffset to month kwarg
jbrockmendel Sep 24, 2017
36290d2
Restrict SemiMonthOffset kwargs to day_of_month
jbrockmendel Sep 24, 2017
4443d6c
Lock down kwargs in FY5253 and FY5253Quarter
jbrockmendel Sep 24, 2017
8cb6b66
lock down kwargs in BusinessDay, CustomBusinessMonthEnd
jbrockmendel Sep 24, 2017
fe7bb56
Lockdown kwargs in remaining DateOffset subclasses
jbrockmendel Sep 24, 2017
3daab66
Briefer WhatsNew, add missing kwds attrs
jbrockmendel Sep 24, 2017
aefb68c
whitespace fixups
jbrockmendel Sep 24, 2017
1e06d99
Move doc section to other api changes bullet point
jbrockmendel Sep 26, 2017
7be31da
Merge branch 'master' into offset_sigs
jbrockmendel Sep 26, 2017
cd1f224
Add pickle tests for 0.19.2 and 0.20.3
jbrockmendel Sep 29, 2017
97c896e
Merge branch 'offset_sigs' of https://github.com/jbrockmendel/pandas …
jbrockmendel Sep 29, 2017
e93de50
Merge branch 'master' of https://github.com/pandas-dev/pandas into of…
jbrockmendel Sep 29, 2017
7426265
Merge branch 'master' of https://github.com/pandas-dev/pandas into of…
jbrockmendel Oct 2, 2017
aee75de
New version of test_pickle_v0_20_3
jbrockmendel Oct 2, 2017
cc5a71a
flake8 whitespace fixup
jbrockmendel Oct 3, 2017
521a8d0
Merge branch 'master' of https://github.com/pandas-dev/pandas into of…
jbrockmendel Oct 3, 2017
217a558
remove test per reviewer instruction
jbrockmendel Oct 4, 2017
086b485
Add offsets with kwds to generate_legacy_storage_files
jbrockmendel Oct 6, 2017
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
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.21.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ Other API Changes
- :func:`to_datetime` when passed a tz-aware ``origin=`` kwarg will now raise a more informative ``ValueError`` rather than a ``TypeError`` (:issue:`16842`)
- Renamed non-functional ``index`` to ``index_col`` in :func:`read_stata` to improve API consistency (:issue:`16342`)
- Bug in :func:`DataFrame.drop` caused boolean labels ``False`` and ``True`` to be treated as labels 0 and 1 respectively when dropping indices from a numeric index. This will now raise a ValueError (:issue:`16877`)
- Restricted DateOffset keyword arguments. Previously, ``DateOffset`` subclasses allowed arbitrary keyword arguments which could lead to unexpected behavior. Now, only valid arguments will be accepted. (:issue:`17176`).

.. _whatsnew_0210.deprecations:

Expand Down
187 changes: 187 additions & 0 deletions pandas/tests/tseries/data/dateoffset_0_19_2.pickle
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
(dp0
S'YearBegin'
p1
ccopy_reg
_reconstructor
Copy link
Contributor

Choose a reason for hiding this comment

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

not what i asked for at all

pls use the generate_legacy_data script
we have removed all of these ad hoc pickle things
we r not adding them back

Copy link
Member Author

Choose a reason for hiding this comment

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

You asked me to run a script that doesn't work, then to troubleshoot it until it does. I found existing tests and followed their example. Please cut me some darn slack.

we have removed all of these ad hoc pickle things

test_pickle_v0_15_2 and test_pickle_compat_0_14_1 might lead a naive reader (such as myself) to suspect otherwise.

you can use pandas versions to do that ONLY in that script to do that.

This sentence confuses me.

If you make changes [to the generation script] then they should be checked in as part of this PR.

I have no interest in making changes to the non-functional generation script.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have no interest in making changes to the non-functional generation script.

well it works fine according to the instructions I gave and has been used for quite a while.

test_pickle_v0_15_2 and test_pickle_compat_0_14_1 might lead a naive reader

well if you look at what exists, the vast majority are in an organized format. The remaining ones should actually be converted to this format.

(pandas) bash-3.2$ find pandas -name '*pickle*'
pandas/compat/__pycache__/pickle_compat.cpython-36.pyc
pandas/compat/pickle_compat.py
pandas/io/__pycache__/pickle.cpython-36.pyc
pandas/io/pickle.py
pandas/tests/indexes/data/mindex_073.pickle
pandas/tests/indexes/data/multiindex_v1.pickle
pandas/tests/io/__pycache__/test_pickle.cpython-36-PYTEST.pyc
pandas/tests/io/data/categorical_0_14_1.pickle
pandas/tests/io/data/categorical_0_15_2.pickle
pandas/tests/io/data/legacy_pickle
pandas/tests/io/data/legacy_pickle/0.10.1/AMD64_windows_2.7.3.pickle
pandas/tests/io/data/legacy_pickle/0.10.1/x86_64_linux_2.7.3.pickle
pandas/tests/io/data/legacy_pickle/0.11.0/0.11.0_x86_64_linux_3.3.0.pickle
pandas/tests/io/data/legacy_pickle/0.11.0/x86_64_linux_2.7.3.pickle
pandas/tests/io/data/legacy_pickle/0.11.0/x86_64_linux_3.3.0.pickle
pandas/tests/io/data/legacy_pickle/0.12.0/0.12.0_AMD64_windows_2.7.3.pickle
pandas/tests/io/data/legacy_pickle/0.12.0/0.12.0_x86_64_linux_2.7.3.pickle
pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_AMD64_windows_2.7.3.pickle
pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.6.5.pickle
pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.7.3.pickle
pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_i686_linux_3.2.3.pickle
pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_darwin_2.7.5.pickle
pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_darwin_2.7.6.pickle
pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_2.7.3.pickle
pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_2.7.8.pickle
pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_3.3.0.pickle
pandas/tests/io/data/legacy_pickle/0.14.0/0.14.0_x86_64_darwin_2.7.6.pickle
pandas/tests/io/data/legacy_pickle/0.14.0/0.14.0_x86_64_linux_2.7.8.pickle
pandas/tests/io/data/legacy_pickle/0.14.1/0.14.1_x86_64_darwin_2.7.12.pickle
pandas/tests/io/data/legacy_pickle/0.14.1/0.14.1_x86_64_linux_2.7.8.pickle
pandas/tests/io/data/legacy_pickle/0.15.0/0.15.0_x86_64_darwin_2.7.12.pickle
pandas/tests/io/data/legacy_pickle/0.15.0/0.15.0_x86_64_linux_2.7.8.pickle
pandas/tests/io/data/legacy_pickle/0.15.2/0.15.2_x86_64_darwin_2.7.9.pickle
pandas/tests/io/data/legacy_pickle/0.16.0/0.16.0_x86_64_darwin_2.7.9.pickle
pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_AMD64_windows_2.7.10.pickle
pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_AMD64_windows_3.4.3.pickle
pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_darwin_2.7.10.pickle
pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_darwin_2.7.9.pickle
pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_darwin_3.4.3.pickle
pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_linux_2.7.10.pickle
pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_linux_3.4.3.pickle
pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_AMD64_windows_2.7.11.pickle
pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_AMD64_windows_3.4.4.pickle
pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_darwin_2.7.11.pickle
pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_darwin_3.4.4.pickle
pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_linux_2.7.11.pickle
pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_linux_3.4.4.pickle
pandas/tests/io/data/legacy_pickle/0.17.0/0.17.1_AMD64_windows_2.7.11.pickle
pandas/tests/io/data/legacy_pickle/0.17.1/0.17.1_AMD64_windows_2.7.11.pickle
pandas/tests/io/data/legacy_pickle/0.17.1/0.17.1_x86_64_darwin_2.7.11.pickle
pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_AMD64_windows_2.7.11.pickle
pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_AMD64_windows_3.5.1.pickle
pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_x86_64_darwin_2.7.11.pickle
pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_x86_64_darwin_3.5.1.pickle
pandas/tests/io/data/legacy_pickle/0.18.1/0.18.1_x86_64_darwin_2.7.12.pickle
pandas/tests/io/data/legacy_pickle/0.18.1/0.18.1_x86_64_darwin_3.5.2.pickle
pandas/tests/io/data/legacy_pickle/0.19.2/0.19.2_x86_64_darwin_2.7.12.pickle
pandas/tests/io/data/legacy_pickle/0.19.2/0.19.2_x86_64_darwin_3.6.1.pickle
pandas/tests/io/test_pickle.py
pandas/tests/tseries/data/cday-0.14.1.pickle
pandas/tests/tseries/data/dateoffset_0_15_2.pickle

As you know pandas is a very large library. If things do not have process & procedure around them, then future generations will have pain. We have worked pretty hard (and you are contributing to this), to reduce technical debt.

p2
(cpandas.tseries.offsets
YearBegin
p3
c__builtin__
object
p4
Ntp5
Rp6
(dp7
S'normalize'
p8
I00
sS'kwds'
p9
(dp10
sS'n'
p11
I1
sS'_offset'
p12
cdatetime
timedelta
p13
(I1
I0
I0
tp14
Rp15
sS'month'
p16
I1
sS'_use_relativedelta'
p17
I00
sbsS'Week'
p18
g2
(cpandas.tseries.offsets
Week
p19
g4
Ntp20
Rp21
(dp22
g8
I00
sS'_inc'
p23
g13
(I7
I0
I0
tp24
Rp25
sg9
(dp26
sS'weekday'
p27
Nsg11
I1
sbsS'MonthBegin'
p28
g2
(cpandas.tseries.offsets
MonthBegin
p29
g4
Ntp30
Rp31
(dp32
g8
I00
sg12
g13
(I1
I0
I0
tp33
Rp34
sg17
I00
sg9
(dp35
sg11
I1
sbsS'Day'
p36
g2
(cpandas.tseries.offsets
Day
p37
g4
Ntp38
Rp39
(dp40
g8
I00
sg12
g13
(I1
I0
I0
tp41
Rp42
sg17
I00
sg9
(dp43
sg11
I1
sbsS'DateOffset'
p44
g2
(cpandas.tseries.offsets
DateOffset
p45
g4
Ntp46
Rp47
(dp48
g8
I00
sg12
g2
(cdateutil.relativedelta
relativedelta
p49
g4
Ntp50
Rp51
(dp52
S'_has_time'
p53
I0
sS'hour'
p54
NsS'seconds'
p55
I0
sS'months'
p56
I0
sS'year'
p57
NsS'days'
p58
I0
sS'years'
p59
I1
sS'hours'
p60
I0
sS'second'
p61
NsS'microsecond'
p62
Nsg16
NsS'microseconds'
p63
I0
sS'leapdays'
p64
I0
sS'minutes'
p65
I0
sS'day'
p66
NsS'minute'
p67
Nsg27
Nsbsg17
I01
sg9
(dp68
g59
I1
ssg11
I1
sbs.
187 changes: 187 additions & 0 deletions pandas/tests/tseries/data/dateoffset_0_20_3.pickle
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
(dp0
S'YearBegin'
p1
ccopy_reg
_reconstructor
p2
(cpandas.tseries.offsets
YearBegin
p3
c__builtin__
object
p4
Ntp5
Rp6
(dp7
S'normalize'
p8
I00
sS'kwds'
p9
(dp10
sS'n'
p11
I1
sS'_offset'
p12
cdatetime
timedelta
p13
(I1
I0
I0
tp14
Rp15
sS'month'
p16
I1
sS'_use_relativedelta'
p17
I00
sbsS'Week'
p18
g2
(cpandas.tseries.offsets
Week
p19
g4
Ntp20
Rp21
(dp22
g8
I00
sS'_inc'
p23
g13
(I7
I0
I0
tp24
Rp25
sg9
(dp26
sS'weekday'
p27
Nsg11
I1
sbsS'MonthBegin'
p28
g2
(cpandas.tseries.offsets
MonthBegin
p29
g4
Ntp30
Rp31
(dp32
g8
I00
sg12
g13
(I1
I0
I0
tp33
Rp34
sg17
I00
sg9
(dp35
sg11
I1
sbsS'Day'
p36
g2
(cpandas.tseries.offsets
Day
p37
g4
Ntp38
Rp39
(dp40
g8
I00
sg12
g13
(I1
I0
I0
tp41
Rp42
sg17
I00
sg9
(dp43
sg11
I1
sbsS'DateOffset'
p44
g2
(cpandas.tseries.offsets
DateOffset
p45
g4
Ntp46
Rp47
(dp48
g8
I00
sg12
g2
(cdateutil.relativedelta
relativedelta
p49
g4
Ntp50
Rp51
(dp52
S'_has_time'
p53
I0
sS'hour'
p54
NsS'seconds'
p55
I0
sS'months'
p56
I0
sS'year'
p57
NsS'days'
p58
I0
sS'years'
p59
I1
sS'hours'
p60
I0
sS'second'
p61
NsS'microsecond'
p62
Nsg16
NsS'microseconds'
p63
I0
sS'leapdays'
p64
I0
sS'minutes'
p65
I0
sS'day'
p66
NsS'minute'
p67
Nsg27
Nsbsg17
I01
sg9
(dp68
g59
I1
ssg11
I1
sbs.
Loading