Skip to content

CLN: flake8 cleanup of core.internals #19202

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

Closed
wants to merge 2 commits into from
Closed
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
28 changes: 14 additions & 14 deletions pandas/core/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ def fill_value(self):
def mgr_locs(self):
return self._mgr_locs

@mgr_locs.setter
def mgr_locs(self, new_mgr_locs):
if not isinstance(new_mgr_locs, BlockPlacement):
new_mgr_locs = BlockPlacement(new_mgr_locs)

self._mgr_locs = new_mgr_locs

@property
def array_dtype(self):
""" the dtype to return if I want to construct this block as an
Expand Down Expand Up @@ -224,13 +231,6 @@ def make_block_same_class(self, values, placement=None, fastpath=True,
return make_block(values, placement=placement, klass=self.__class__,
fastpath=fastpath, **kwargs)

@mgr_locs.setter
def mgr_locs(self, new_mgr_locs):
if not isinstance(new_mgr_locs, BlockPlacement):
new_mgr_locs = BlockPlacement(new_mgr_locs)

self._mgr_locs = new_mgr_locs

def __unicode__(self):

# don't want to print out all of the items here
Expand Down Expand Up @@ -633,7 +633,7 @@ def _astype(self, dtype, copy=False, errors='raise', values=None,

newb = make_block(values, placement=self.mgr_locs, dtype=dtype,
klass=klass)
except:
except Exception:
if errors == 'raise':
raise
newb = self.copy() if copy else self
Expand Down Expand Up @@ -840,7 +840,6 @@ def setitem(self, indexer, value, mgr=None):

transf = (lambda x: x.T) if self.ndim == 2 else (lambda x: x)
values = transf(values)
l = len(values)

# length checking
# boolean with truth values == len of the value is ok too
Expand All @@ -855,7 +854,7 @@ def setitem(self, indexer, value, mgr=None):
# slice
elif isinstance(indexer, slice):

if is_list_like(value) and l:
if is_list_like(value) and len(values):
if len(value) != length_of_indexer(indexer, values):
raise ValueError("cannot set using a slice indexer with a "
"different length than the value")
Expand Down Expand Up @@ -1108,7 +1107,7 @@ def check_int_bool(self, inplace):
# a fill na type method
try:
m = missing.clean_fill_method(method)
except:
except ValueError:
m = None

if m is not None:
Expand All @@ -1123,7 +1122,7 @@ def check_int_bool(self, inplace):
# try an interp method
try:
m = missing.clean_interp_method(method, **kwargs)
except:
except ValueError:
m = None

if m is not None:
Expand Down Expand Up @@ -2166,7 +2165,7 @@ def set(self, locs, values, check=False):
try:
if (self.values[locs] == values).all():
return
except:
except Exception:
pass
try:
self.values[locs] = values
Expand Down Expand Up @@ -2807,7 +2806,8 @@ def _astype(self, dtype, copy=False, errors='raise', values=None,
def __len__(self):
try:
return self.sp_index.length
except:
except Exception:
Copy link
Contributor

Choose a reason for hiding this comment

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

enumerate these

Copy link
Member Author

Choose a reason for hiding this comment

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

Please read my previous comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

I did it was not helpful. you need to specify here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did it was not helpful. you need to specify here.

Of course it wasn't helpful. It was asking for help!

Screw it, closing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Any idea what the failure mode here is?

@jreback was the comment @jbrockmendel referred to. Saying it was "not helpful" is driving away contributors.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jbrockmendel my point is that saying ping I am ready when you haven't answer my questions is not helpful.

Copy link
Contributor

Choose a reason for hiding this comment

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

I spend an enormous amounts of my time reviewing PR's and we have a lot of them. I do except answers to comments that I make.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm guessing these last two comments are about a "ping" over in #19139, where I had answered the question but that answer was ignored.

# TODO: Catch something more specific?
return 0

def copy(self, deep=True, mgr=None):
Expand Down