Skip to content
Open
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
15 changes: 9 additions & 6 deletions pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,11 @@ def _is_metadata_of(group: Node, parent_group: Node) -> bool:
current = group
while current._v_depth > 1:
parent = current._v_parent
if parent == parent_group and current._v_name == "meta":
return True
if parent == parent_group:
if current._v_name == "meta":
return True
else:
return False
current = current._v_parent
return False

Expand Down Expand Up @@ -1750,7 +1753,7 @@ def info(self) -> str:

if self.is_open:
lkeys = sorted(self.keys())
if len(lkeys):
if lkeys:
keys = []
values = []

Expand Down Expand Up @@ -4505,7 +4508,7 @@ def write_data(self, chunksize: int | None, dropna: bool = False) -> None:
masks.append(mask.astype("u1", copy=False))

# consolidate masks
if len(masks):
if masks:
mask = masks[0]
for m in masks[1:]:
mask = mask & m
Expand Down Expand Up @@ -4625,7 +4628,7 @@ def delete(
groups = list(diff[diff > 1].index)

# 1 group
if not len(groups):
if not groups:
groups = [0]

# final element
Expand Down Expand Up @@ -5091,7 +5094,7 @@ def _maybe_convert_for_string_atom(
if bvalues.dtype != object:
return bvalues

bvalues = cast(np.ndarray, bvalues)
bvalues = cast("np.ndarray", bvalues)

dtype_name = bvalues.dtype.name
inferred_type = lib.infer_dtype(bvalues, skipna=False)
Expand Down