Skip to content

Commit 029954b

Browse files
author
MomIsBestFriend
committed
Removed new created code
1 parent 025a493 commit 029954b

File tree

3 files changed

+4
-68
lines changed

3 files changed

+4
-68
lines changed

pandas/_libs/tslibs/nattype.pyx

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -467,36 +467,7 @@ class NaTType(_NaT):
467467
Return a new Timestamp representing UTC day and time.
468468
"""
469469
)
470-
fromisocalendar = _make_error_func('fromisocalendar', # noqa:E128
471-
"""
472-
Timestamp.fromisocalendar(year, week, day)
473-
474-
Return a new Timestamp corresponding to the
475-
ISO calendar date specified by year, week and day.
476470

477-
Parameters
478-
----------
479-
year: int
480-
Representing a year.
481-
week : int
482-
Value between 1-53, representing a week in a year.
483-
day : int
484-
Value between 1-7, representing a day in the week.
485-
486-
Returns
487-
-------
488-
Timestamp
489-
490-
Raises
491-
------
492-
NotImplementedError
493-
If the running platform is a Python version earlier than 3.8
494-
495-
Notes
496-
-----
497-
`week` can have the value of 53, only when year is a leap year.
498-
"""
499-
)
500471
timestamp = _make_error_func('timestamp', # noqa:E128
501472
"""Return POSIX timestamp as float.""")
502473

pandas/_libs/tslibs/timestamps.pyx

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -336,45 +336,6 @@ class Timestamp(_Timestamp):
336336
"""
337337
return cls(datetime.combine(date, time))
338338

339-
@classmethod
340-
def fromisocalendar(cls, year, week, day):
341-
"""
342-
Timestamp.fromisocalendar(year, week, day)
343-
344-
Return a new Timestamp corresponding to the
345-
ISO calendar date specified by year, week and day.
346-
347-
Parameters
348-
----------
349-
year: int
350-
Representing a year.
351-
week : int
352-
Value between 1-53, representing a week in a year.
353-
day : int
354-
Value between 1-7, representing a day in the week.
355-
356-
Returns
357-
-------
358-
Timestamp
359-
360-
Raises
361-
------
362-
NotImplementedError
363-
If the running platform is a Python version earlier than 3.8
364-
365-
Notes
366-
-----
367-
`week` can have the value of 53, only when year is a leap year.
368-
"""
369-
import pandas.compat as compat
370-
371-
if not compat.PY38:
372-
raise NotImplementedError(
373-
"'fromisocalendar' is not supported for versions earlier than 3.8"
374-
)
375-
376-
return cls(datetime.fromisocalendar(year, week, day))
377-
378339
def __new__(
379340
cls,
380341
object ts_input=_no_input,

pandas/tests/scalar/test_nat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ def test_overlap_public_nat_methods(klass, expected):
298298
if klass is Timestamp and not compat.PY37:
299299
expected.remove("fromisoformat")
300300

301+
# "fromisocalendar" was introduced in 3.8
302+
if klass is Timestamp and not compat.PY38:
303+
expected.remove("fromisocalendar")
304+
301305
assert _get_overlap_public_nat_methods(klass) == expected
302306

303307

0 commit comments

Comments
 (0)