Skip to content

CLN: remove StringMixin from code base, except in core.computation #26523

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 1 commit into from
May 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 9 additions & 10 deletions pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
to_datetime)
from pandas.core.arrays.categorical import Categorical
from pandas.core.arrays.sparse import BlockIndex, IntIndex
from pandas.core.base import StringMixin
import pandas.core.common as com
from pandas.core.computation.pytables import Expr, maybe_expression
from pandas.core.index import ensure_index
Expand Down Expand Up @@ -398,7 +397,7 @@ def _is_metadata_of(group, parent_group):
return False


class HDFStore(StringMixin):
class HDFStore:

"""
Dict-like IO interface for storing pandas objects in PyTables
Expand Down Expand Up @@ -520,7 +519,7 @@ def __contains__(self, key):
def __len__(self):
return len(self.groups())

def __str__(self):
def __repr__(self):
return '{type}\nFile path: {path}\n'.format(
type=type(self), path=pprint_thing(self._path))

Expand Down Expand Up @@ -1519,7 +1518,7 @@ def get_result(self, coordinates=False):
return results


class IndexCol(StringMixin):
class IndexCol:

""" an index column description class

Expand Down Expand Up @@ -1587,7 +1586,7 @@ def set_table(self, table):
self.table = table
return self

def __str__(self):
def __repr__(self):
temp = tuple(
map(pprint_thing,
(self.name,
Expand Down Expand Up @@ -1881,7 +1880,7 @@ def __init__(self, values=None, kind=None, typ=None,
self.set_data(data)
self.set_metadata(metadata)

def __str__(self):
def __repr__(self):
temp = tuple(
map(pprint_thing,
(self.name,
Expand Down Expand Up @@ -2286,7 +2285,7 @@ def get_attr(self):
pass


class Fixed(StringMixin):
class Fixed:

""" represent an object in my store
facilitate read/write of various types of objects
Expand Down Expand Up @@ -2336,7 +2335,7 @@ def pandas_type(self):
def format_type(self):
return 'fixed'

def __str__(self):
def __repr__(self):
""" return a pretty representation of myself """
self.infer_axes()
s = self.shape
Expand Down Expand Up @@ -3077,8 +3076,8 @@ def table_type_short(self):
def format_type(self):
return 'table'

def __str__(self):
""" return a pretty representatgion of myself """
def __repr__(self):
""" return a pretty representation of myself """
self.infer_axes()
dc = ",dc->[{columns}]".format(columns=(','.join(
self.data_columns) if len(self.data_columns) else ''))
Expand Down
3 changes: 1 addition & 2 deletions pandas/io/stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from pandas import (
Categorical, DatetimeIndex, NaT, Timestamp, concat, isna, to_datetime,
to_timedelta)
from pandas.core.base import StringMixin
from pandas.core.frame import DataFrame
from pandas.core.series import Series

Expand Down Expand Up @@ -712,7 +711,7 @@ def generate_value_label(self, byteorder, encoding):
return bio.read()


class StataMissingValue(StringMixin):
class StataMissingValue:
"""
An observation's missing value.

Expand Down