Skip to content

CLN: address TODOs and FIXMEs #34033

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 43 commits into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
67ab32f
TST: fix xfailed arithmetic tests
jbrockmendel Apr 28, 2020
ae3837c
TST: strictify xfails
jbrockmendel Apr 28, 2020
63cbaa9
strictify
jbrockmendel Apr 28, 2020
5338c37
strictify xfail
jbrockmendel Apr 28, 2020
5ba2112
stricter
jbrockmendel Apr 28, 2020
13d93bf
fix xfail
jbrockmendel Apr 28, 2020
a8328bc
tighten
jbrockmendel Apr 28, 2020
7ed3c67
take it all back
jbrockmendel Apr 28, 2020
3f4fcbf
tighten tests
jbrockmendel Apr 28, 2020
45b3cbb
CI: Skip permissions test when running as sudo (#33847)
TomAugspurger Apr 28, 2020
1ce5589
troubleshoot
jbrockmendel Apr 28, 2020
3fe8ab3
TST: stop skipping Categorical take tests (#33859)
jbrockmendel Apr 29, 2020
a2d025e
Fix typo (#33861)
taljaards Apr 29, 2020
82e2463
REF/CLN: Parametrize _isna (#33835)
dsaxton Apr 29, 2020
306044b
DOC: Code Standards Broken Link (#33865)
simonjayhawkins Apr 29, 2020
c6845da
TYP/CLN: remove #type: ignore from pandas\tests\base\test_conversion.…
simonjayhawkins Apr 29, 2020
f898f4b
CLN: address FIXME/TODO/XXX comments (#33858)
jbrockmendel Apr 29, 2020
ef09e64
DOC: Remove TODO from `test_openpyxl` (#33872)
charlesdong1991 Apr 29, 2020
3a56433
Merge branch 'master' of https://github.com/pandas-dev/pandas into xf…
jbrockmendel Apr 29, 2020
7451dbc
Merge branch 'master' of https://github.com/pandas-dev/pandas into xf…
jbrockmendel Apr 29, 2020
7bf479b
remove box_df_fail
jbrockmendel Apr 29, 2020
6863882
TST: cactch/suppress warnings
jbrockmendel Apr 29, 2020
32666d9
TST: catch/suppress warnings
jbrockmendel Apr 29, 2020
f27775c
TST: dynamic xfails
jbrockmendel Apr 29, 2020
72096cf
Merge branch 'master' of https://github.com/pandas-dev/pandas into xf…
jbrockmendel Apr 29, 2020
67e8731
troubleshoot CI
jbrockmendel Apr 30, 2020
5ab07c5
Merge branch 'master' of https://github.com/pandas-dev/pandas into xf…
jbrockmendel Apr 30, 2020
650aed3
un-silence
jbrockmendel Apr 30, 2020
954994d
troubleshoot CI
jbrockmendel Apr 30, 2020
33d2aab
troubleshoot CI
jbrockmendel Apr 30, 2020
8641843
revert
jbrockmendel Apr 30, 2020
930a421
troubleshoot interval
jbrockmendel Apr 30, 2020
be3a449
Merge branch 'master' of https://github.com/pandas-dev/pandas into xf…
jbrockmendel May 1, 2020
1ee6952
CLN: address TODOs
jbrockmendel Apr 30, 2020
5d54164
revert
jbrockmendel May 1, 2020
9b6c270
DOC: Fix groupby.agg/transform rst reference and numba references (#3…
mroeschke May 1, 2020
6c1901c
COMPAT: add back block manager constructors to pandas.core.internals …
jorisvandenbossche May 1, 2020
839d8e8
DEPR: get_value (#33907)
jbrockmendel May 1, 2020
be8ef9d
BUG: can't concatenate DataFrame with Series with duplicate keys (#33…
MarcoGorelli May 1, 2020
5392a7b
Merge branch 'master' of https://github.com/pandas-dev/pandas into fi…
jbrockmendel May 1, 2020
742b9ac
Merge branch 'master' of https://github.com/pandas-dev/pandas into fi…
jbrockmendel May 2, 2020
f99681d
Merge branch 'master' of https://github.com/pandas-dev/pandas into fi…
jbrockmendel May 6, 2020
e7be0ab
Address TODOs/FIXMEs
jbrockmendel May 6, 2020
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
6 changes: 3 additions & 3 deletions pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from pandas._config import get_option

from pandas._libs import algos as libalgos, hashtable as htable
from pandas._libs import NaT, algos as libalgos, hashtable as htable
from pandas._typing import ArrayLike, Dtype, Ordered, Scalar
from pandas.util._decorators import cache_readonly, deprecate_kwarg, doc
from pandas.util._validators import validate_bool_kwarg, validate_fillna_kwargs
Expand Down Expand Up @@ -344,7 +344,7 @@ def __init__(
) from err
except ValueError as err:

# FIXME
# TODO(EA2D)
raise NotImplementedError(
"> 1 ndim Categorical are not supported at this time"
) from err
Expand Down Expand Up @@ -1425,7 +1425,7 @@ def _internal_get_values(self):
"""
# if we are a datetime and period index, return Index to keep metadata
if needs_i8_conversion(self.categories.dtype):
return self.categories.take(self._codes, fill_value=np.nan)
return self.categories.take(self._codes, fill_value=NaT)
elif is_integer_dtype(self.categories) and -1 in self._codes:
return self.categories.astype("object").take(self._codes, fill_value=np.nan)
return np.array(self)
Expand Down
3 changes: 1 addition & 2 deletions pandas/core/config_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,7 @@ def _deprecate_negative_int_max_colwidth(key):
)

cf.register_option(
# FIXME: change `validator=is_nonnegative_int`
# in version 1.2
# TODO(2.0): change `validator=is_nonnegative_int` see GH#31569
"max_colwidth",
50,
max_colwidth_doc,
Expand Down
2 changes: 0 additions & 2 deletions pandas/core/dtypes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ def is_period_dtype(arr_or_dtype) -> bool:
# GH#33400 fastpath for dtype object
return arr_or_dtype.type is Period

# TODO: Consider making Period an instance of PeriodDtype
if arr_or_dtype is None:
return False
return PeriodDtype.is_dtype(arr_or_dtype)
Expand Down Expand Up @@ -523,7 +522,6 @@ def is_interval_dtype(arr_or_dtype) -> bool:
# GH#33400 fastpath for dtype object
return arr_or_dtype.type is Interval

# TODO: Consider making Interval an instance of IntervalDtype
if arr_or_dtype is None:
return False
return IntervalDtype.is_dtype(arr_or_dtype)
Expand Down
4 changes: 1 addition & 3 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -8338,9 +8338,7 @@ def blk_func(values):
assert len(res) == max(list(res.keys())) + 1, res.keys()
out = df._constructor_sliced(res, index=range(len(res)), dtype=out_dtype)
out.index = df.columns
if axis == 0 and df.dtypes.apply(needs_i8_conversion).any():
# FIXME: needs_i8_conversion check is kludge, not sure
# why it is necessary in this case and this case alone
if axis == 0 and is_object_dtype(out.dtype):
out[:] = coerce_to_dtypes(out.values, df.dtypes)
return out

Expand Down
3 changes: 0 additions & 3 deletions pandas/core/internals/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,9 +1284,6 @@ def _slice_take_blocks_ax0(self, slice_or_indexer, fill_value=lib.no_default):

# When filling blknos, make sure blknos is updated before appending to
# blocks list, that way new blkno is exactly len(blocks).
#
# FIXME: mgr_groupby_blknos must return mgr_locs in ascending order,
# pytables serialization will break otherwise.
blocks = []
for blkno, mgr_locs in libinternals.get_blkno_placements(blknos, group=True):
if blkno == -1:
Expand Down
10 changes: 5 additions & 5 deletions pandas/tests/extension/test_boolean.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ def test_error(self, data, all_arithmetic_operators):
# other specific errors tested in the boolean array specific tests
pass

def test_arith_frame_with_scalar(self, data, all_arithmetic_operators):
def test_arith_frame_with_scalar(self, data, all_arithmetic_operators, request):
# frame & scalar
op_name = all_arithmetic_operators
if op_name in self.implements:
super().test_arith_frame_with_scalar(data, all_arithmetic_operators)
else:
pytest.xfail("_reduce needs implementation")
if op_name not in self.implements:
mark = pytest.mark.xfail(reason="_reduce needs implementation")
request.node.add_marker(mark)
super().test_arith_frame_with_scalar(data, all_arithmetic_operators)


class TestComparisonOps(base.BaseComparisonOpsTests):
Expand Down
20 changes: 15 additions & 5 deletions pandas/tests/extension/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,20 +175,30 @@ def test_take_series(self, data):
# ValueError: PandasArray must be 1-dimensional.
super().test_take_series(data)

def test_loc_iloc_frame_single_dtype(self, data):
def test_loc_iloc_frame_single_dtype(self, data, request):
npdtype = data.dtype.numpy_dtype
if npdtype == object or npdtype == np.float64:
# GH#33125
pytest.xfail(reason="GH#33125 astype doesn't recognize data.dtype")
mark = pytest.mark.xfail(
reason="GH#33125 astype doesn't recognize data.dtype"
)
request.node.add_marker(mark)
super().test_loc_iloc_frame_single_dtype(data)


class TestGroupby(BaseNumPyTests, base.BaseGroupbyTests):
@skip_nested
def test_groupby_extension_apply(self, data_for_grouping, groupby_apply_op):
def test_groupby_extension_apply(
self, data_for_grouping, groupby_apply_op, request
):
# ValueError: Names should be list-like for a MultiIndex
if data_for_grouping.dtype.numpy_dtype == np.float64:
pytest.xfail(reason="GH#33125 astype doesn't recognize data.dtype")
a = "a"
is_identity = groupby_apply_op(a) is a
if data_for_grouping.dtype.numpy_dtype == np.float64 and is_identity:
mark = pytest.mark.xfail(
reason="GH#33125 astype doesn't recognize data.dtype"
)
request.node.add_marker(mark)
super().test_groupby_extension_apply(data_for_grouping, groupby_apply_op)


Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/groupby/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,15 +1260,16 @@ def test_get_nonexistent_category():


def test_series_groupby_on_2_categoricals_unobserved(
reduction_func: str, observed: bool
reduction_func: str, observed: bool, request
):
# GH 17605

if reduction_func == "ngroup":
pytest.skip("ngroup is not truly a reduction")

if reduction_func == "corrwith": # GH 32293
pytest.xfail("TODO: implemented SeriesGroupBy.corrwith")
mark = pytest.mark.xfail(reason="TODO: implemented SeriesGroupBy.corrwith")
request.node.add_marker(mark)

df = pd.DataFrame(
{
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/test_downstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def test_pandas_gbq(df):
pandas_gbq = import_module("pandas_gbq") # noqa


@pytest.mark.xfail(reason="0.7.0 pending")
@pytest.mark.xfail(reason="0.8.1 tries to import urlencode from pd.io.common")
@tm.network
def test_pandas_datareader():

Expand Down