Skip to content

Make _freq/freq/tz/_tz/dtype/_dtype/offset/_offset all inherit reliably #24517

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 7 commits into from
Jan 1, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
revert move of offset prop
  • Loading branch information
jbrockmendel committed Dec 31, 2018
commit b0fb9643dd19d2cb64c736cb6d7199bd97a41f68
24 changes: 0 additions & 24 deletions pandas/core/indexes/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,30 +100,6 @@ def wrapper(self, other):

# ------------------------------------------------------------------------

@property
def offset(self):
"""
get/set the frequency of the instance
"""
msg = ('{cls}.offset has been deprecated and will be removed '
'in a future version; use {cls}.freq instead.'
.format(cls=type(self).__name__))
warnings.warn(msg, FutureWarning, stacklevel=2)
return self.freq

@offset.setter
def offset(self, value):
"""
get/set the frequency of the instance
"""
msg = ('{cls}.offset has been deprecated and will be removed '
'in a future version; use {cls}.freq instead.'
.format(cls=type(self).__name__))
warnings.warn(msg, FutureWarning, stacklevel=2)
self.freq = value

# ------------------------------------------------------------------------

def equals(self, other):
"""
Determines if two Index objects contain the same elements.
Expand Down
22 changes: 22 additions & 0 deletions pandas/core/indexes/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,28 @@ def tz(self, value):
_has_same_tz = ea_passthrough("_has_same_tz")
__array__ = ea_passthrough("__array__")

@property
def offset(self):
"""
get/set the frequency of the instance
"""
msg = ('{cls}.offset has been deprecated and will be removed '
'in a future version; use {cls}.freq instead.'
.format(cls=type(self).__name__))
warnings.warn(msg, FutureWarning, stacklevel=2)
return self.freq

@offset.setter
def offset(self, value):
"""
get/set the frequency of the instance
"""
msg = ('{cls}.offset has been deprecated and will be removed '
'in a future version; use {cls}.freq instead.'
.format(cls=type(self).__name__))
warnings.warn(msg, FutureWarning, stacklevel=2)
self.freq = value

def __getitem__(self, key):
result = self._eadata.__getitem__(key)
if is_scalar(result):
Expand Down