Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5eaa8d0
Adding depracated warning for units M and Y
ryankarlos Oct 21, 2018
0a836d2
Added M and Y units deprecated test and whats new note
ryankarlos Nov 12, 2018
e890fa6
Small fixes
ryankarlos Nov 23, 2018
bfe74e5
Updated test
ryankarlos Dec 16, 2018
e5e1198
Modifications
ryankarlos Jan 13, 2019
d0dd551
Fixing errors in Travis tests
ryankarlos Jan 13, 2019
af5d761
Modified whats new doc and seperated tests in different files
ryankarlos Jan 15, 2019
938c6fe
Amend warnings
ryankarlos Jan 15, 2019
16f8b9c
remove stacklevel
ryankarlos Jan 15, 2019
5a64320
Added stack level to warning
ryankarlos Jan 16, 2019
3b67476
added stack_level=False to make tests pass locally
ryankarlos Jan 29, 2019
ab52460
Add check_stacklevel=False to test_range_kwargs_deprecated to remove …
ryankarlos Jan 29, 2019
9cb51c5
Merge remote-tracking branch 'upstream/master' into timedelta_unit_de…
ryankarlos Jan 29, 2019
c6f82c7
Merge branch 'master' of https://github.com/pandas-dev/pandas into ti…
ryankarlos Feb 2, 2019
b1599a5
Added Requested changes
ryankarlos Feb 2, 2019
a21a6a2
Fix linting and add pytest filter warnings decorator
ryankarlos Feb 2, 2019
261672e
add decorator to skip pytest for python 2.7 build
ryankarlos Feb 3, 2019
4010bdb
Reverting changes in unrelated files - see @jorisvandenbossche comment"
ryankarlos Feb 3, 2019
3f87a0b
Minor changes
ryankarlos Feb 3, 2019
b7aedc1
Merge branch 'master' of https://github.com/pandas-dev/pandas into ti…
ryankarlos Feb 3, 2019
f44bae0
Reverting back to checkstacklevel=False for Timdelta as Travis was fa…
ryankarlos Feb 3, 2019
5d2dceb
Merge branch 'master' of https://github.com/pandas-dev/pandas into ti…
ryankarlos Feb 3, 2019
b745b8c
set stacklevel=1 for Timedelta and remove checkstacklevel=False
ryankarlos Feb 4, 2019
d014f56
Merge branch 'master' of https://github.com/pandas-dev/pandas into ti…
ryankarlos Feb 8, 2019
ca0ea09
added requested changes and removed unused sys import - linter
ryankarlos Feb 8, 2019
76497d3
reverting file - removed added line
ryankarlos Feb 8, 2019
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove stacklevel
  • Loading branch information
ryankarlos committed Jan 28, 2019
commit 16f8b9c226bc41a9a35581cd54ec0c5de7168e06
4 changes: 2 additions & 2 deletions pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ class Timedelta(_Timedelta):
if unit in {'Y', 'y', 'M'}:
warnings.warn("M and Y units are deprecated and "
"will be removed in a future version.",
FutureWarning, stacklevel=2)
FutureWarning)

if is_timedelta64_object(value):
value = value.view('i8')
Expand Down Expand Up @@ -1523,4 +1523,4 @@ cdef _broadcast_floordiv_td64(int64_t value, object other,

# resolution in ns
Timedelta.min = Timedelta(np.iinfo(np.int64).min + 1)
Timedelta.max = Timedelta(np.iinfo(np.int64).max)
Timedelta.max = Timedelta(np.iinfo(np.int64).max)
2 changes: 1 addition & 1 deletion pandas/core/indexes/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def __new__(cls, data=None, unit=None, freq=None, start=None, end=None,
if unit in {'Y', 'y', 'M'}:
warnings.warn("M and Y units are deprecated and "
"will be removed in a future version.",
FutureWarning, stacklevel=2)
FutureWarning)
Copy link
Contributor

Choose a reason for hiding this comment

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

try 3


if isinstance(data, TimedeltaArray):
if copy:
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/tools/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def to_timedelta(arg, unit='ns', box=True, errors='raise'):
if unit in {'Y', 'y', 'M'}:
warnings.warn("M and Y units are deprecated and "
"will be removed in a future version.",
FutureWarning, stacklevel=2)
FutureWarning)
Copy link
Contributor

Choose a reason for hiding this comment

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

try 2 or 3


if arg is None:
return arg
Expand Down
1 change: 0 additions & 1 deletion pandas/tests/indexes/timedeltas/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,3 @@ def test_to_timedelta_unit_m_y_deprecated(self, arg, unit):
to_timedelta(arg, unit)
msg = r'.* units are deprecated .*'
assert re.match(msg, str(w[0].message))