Skip to content

Commit cf974b1

Browse files
authored
CLN: address FIXME/TODO/XXX comments (#33858)
1 parent b8c8954 commit cf974b1

File tree

30 files changed

+36
-52
lines changed

30 files changed

+36
-52
lines changed

ci/setup_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ conda list pandas
128128
echo "[Build extensions]"
129129
python setup.py build_ext -q -i -j2
130130

131-
# XXX: Some of our environments end up with old versions of pip (10.x)
131+
# TODO: Some of our environments end up with old versions of pip (10.x)
132132
# Adding a new enough version of pip to the requirements explodes the
133133
# solve time. Just using pip to update itself.
134134
# - py35_macos

pandas/_libs/src/parser/tokenizer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ See LICENSE for the license
5252
#define PARSER_OUT_OF_MEMORY -1
5353

5454
/*
55-
* XXX Might want to couple count_rows() with read_rows() to avoid duplication
56-
* of some file I/O.
55+
* TODO: Might want to couple count_rows() with read_rows() to avoid
56+
* duplication of some file I/O.
5757
*/
5858

5959
typedef enum {

pandas/_libs/tslibs/strptime.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ class TimeRE(dict):
544544
'w': r"(?P<w>[0-6])",
545545
# W is set below by using 'U'
546546
'y': r"(?P<y>\d\d)",
547-
# XXX: Does 'Y' need to worry about having less or more than
547+
# TODO: Does 'Y' need to worry about having less or more than
548548
# 4 digits?
549549
'Y': r"(?P<Y>\d\d\d\d)",
550550
'z': r"(?P<z>[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|Z)",

pandas/core/algorithms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def _ensure_data(values, dtype=None):
142142
if values.ndim > 1 and is_datetime64_ns_dtype(values):
143143
# Avoid calling the DatetimeIndex constructor as it is 1D only
144144
# Note: this is reached by DataFrame.rank calls GH#27027
145+
# TODO(EA2D): special case not needed with 2D EAs
145146
asi8 = values.view("i8")
146147
dtype = values.dtype
147148
return asi8, dtype

pandas/core/arrays/sparse/array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def __init__(
335335
# TODO: disentangle the fill_value dtype inference from
336336
# dtype inference
337337
if data is None:
338-
# XXX: What should the empty dtype be? Object or float?
338+
# TODO: What should the empty dtype be? Object or float?
339339
data = np.array([], dtype=dtype)
340340

341341
if not is_array_like(data):

pandas/core/dtypes/concat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ def concat_categorical(to_concat, axis: int = 0):
178178
]
179179
result = concat_compat(to_concat)
180180
if axis == 1:
181+
# TODO(EA2D): not necessary with 2D EAs
181182
result = result.reshape(1, len(result))
182183
return result
183184

pandas/core/groupby/generic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,7 @@ def _cython_agg_blocks(
11291129
# e.g. block.values was an IntegerArray
11301130
# (1, N) case can occur if block.values was Categorical
11311131
# and result is ndarray[object]
1132+
# TODO(EA2D): special casing not needed with 2D EAs
11321133
assert result.ndim == 1 or result.shape[0] == 1
11331134
try:
11341135
# Cast back if feasible

pandas/core/groupby/ops.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,8 @@ def _cython_operation(
476476

477477
if is_datetime64tz_dtype(values.dtype):
478478
# Cast to naive; we'll cast back at the end of the function
479-
# TODO: possible need to reshape? kludge can be avoided when
480-
# 2D EA is allowed.
479+
# TODO: possible need to reshape?
480+
# TODO(EA2D):kludge can be avoided when 2D EA is allowed.
481481
values = values.view("M8[ns]")
482482

483483
is_datetimelike = needs_i8_conversion(values.dtype)
@@ -717,7 +717,7 @@ def _aggregate_series_pure_python(
717717
if isinstance(res, (Series, Index, np.ndarray)):
718718
if len(res) == 1:
719719
# e.g. test_agg_lambda_with_timezone lambda e: e.head(1)
720-
# FIXME: are we potentially losing import res.index info?
720+
# FIXME: are we potentially losing important res.index info?
721721
res = res.item()
722722
else:
723723
raise ValueError("Function does not reduce")

pandas/core/internals/blocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,7 @@ def take_nd(
17211721
return self.make_block_same_class(new_values, new_mgr_locs)
17221722

17231723
def _can_hold_element(self, element: Any) -> bool:
1724-
# XXX: We may need to think about pushing this onto the array.
1724+
# TODO: We may need to think about pushing this onto the array.
17251725
# We're doing the same as CategoricalBlock here.
17261726
return True
17271727

pandas/core/internals/concat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ def is_na(self):
218218
elif is_sparse(self.block.values.dtype):
219219
return False
220220
elif self.block.is_extension:
221+
# TODO(EA2D): no need for special case with 2D EAs
221222
values_flat = values
222223
else:
223224
values_flat = values.ravel(order="K")

0 commit comments

Comments
 (0)