Skip to content

Commit f68092a

Browse files
committed
Fix line length guidance for value check error messages
1 parent deeaf41 commit f68092a

File tree

9 files changed

+29
-11
lines changed

9 files changed

+29
-11
lines changed

pandas/core/apply.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,8 @@ def normalize_dictlike_arg(
518518
when values consists of a mix of list and non-lists.
519519
"""
520520
if how not in ("apply", "agg", "transform"):
521-
raise ValueError('Value for how argument must be one of : apply, agg, transform')
521+
raise ValueError('Value for how argument must be one of : '
522+
'apply, agg, transform')
522523

523524
# Can't use func.values(); wouldn't work for a Series
524525
if (

pandas/core/arrays/datetimes.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2165,7 +2165,8 @@ def objects_to_datetime64ns(
21652165
ValueError : if data cannot be converted to datetimes
21662166
"""
21672167
if errors not in ["raise", "ignore", "coerce"]:
2168-
raise ValueError('Value for errors argument must be one of: raise, coerce, ignore')
2168+
raise ValueError('Value for errors argument must be one of: '
2169+
'raise, coerce, ignore')
21692170

21702171
# if str-dtype, convert
21712172
data = np.array(data, copy=False, dtype=np.object_)

pandas/core/groupby/ops.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,8 @@ def _cython_operation(
968968
Returns the values of a cython operation.
969969
"""
970970
if kind not in ["transform", "aggregate"]:
971-
raise ValueError('Value for kind argument must be one of: transform, aggregate')
971+
raise ValueError('Value for kind argument must be one of: '
972+
'transform, aggregate')
972973

973974
cy_op = WrappedCythonOp(kind=kind, how=how)
974975

pandas/core/indexes/base.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -5653,7 +5653,12 @@ def _validate_indexer(self, form: str_t, key, kind: str_t):
56535653
if key is not None and not is_integer(key):
56545654
raise self._invalid_indexer(form, key)
56555655

5656-
def _maybe_cast_slice_bound(self, label, side: str_t, kind: Literal["loc", "getitem"] = no_default):
5656+
def _maybe_cast_slice_bound(
5657+
self,
5658+
label,
5659+
side: str_t,
5660+
kind: Literal["loc", "getitem"] = no_default
5661+
):
56575662
"""
56585663
This function should be overloaded in subclasses that allow non-trivial
56595664
casting on label-slice bounds, e.g. datetime-like indices allowing
@@ -5674,7 +5679,8 @@ def _maybe_cast_slice_bound(self, label, side: str_t, kind: Literal["loc", "geti
56745679
Value of `side` parameter should be validated in caller.
56755680
"""
56765681
if kind not in ["loc", "getitem", None, no_default]:
5677-
raise ValueError('Value for kind argument must be one of: loc, getitem or None')
5682+
raise ValueError('Value for kind argument must be one of: '
5683+
'loc, getitem or None')
56785684
self._deprecated_arg(kind, "kind", "_maybe_cast_slice_bound")
56795685

56805686
# We are a plain index here (sub-class override this method if they
@@ -5719,7 +5725,8 @@ def get_slice_bound(self, label, side: str_t, kind=None) -> int:
57195725
Index of label.
57205726
"""
57215727
if kind not in ["loc", "getitem", None]:
5722-
raise ValueError('Value for kind argument must be one of: loc, getitem or None')
5728+
raise ValueError('Value for kind argument must be one of: '
5729+
'loc, getitem or None')
57235730

57245731
if side not in ("left", "right"):
57255732
raise ValueError(

pandas/core/indexes/datetimes.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,8 @@ def _maybe_cast_slice_bound(self, label, side: str, kind=lib.no_default):
729729
Value of `side` parameter should be validated in caller.
730730
"""
731731
if kind not in ["loc", "getitem", None, lib.no_default]:
732-
raise ValueError('Value for kind argument must be one of: loc, getitem or None')
732+
raise ValueError('Value for kind argument must be one of: '
733+
'loc, getitem or None')
733734
self._deprecated_arg(kind, "kind", "_maybe_cast_slice_bound")
734735

735736
if isinstance(label, str):

pandas/core/indexes/numeric.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ def _convert_slice_indexer(self, key: slice, kind: str):
247247
@doc(Index._maybe_cast_slice_bound)
248248
def _maybe_cast_slice_bound(self, label, side: str, kind=lib.no_default):
249249
if kind not in ["loc", "getitem", None, lib.no_default]:
250-
raise ValueError('Value for kind argument must be one of: loc, getitem or None')
250+
raise ValueError('Value for kind argument must be one of: '
251+
'loc, getitem or None')
251252
self._deprecated_arg(kind, "kind", "_maybe_cast_slice_bound")
252253

253254
# we will try to coerce to integers

pandas/core/indexes/period.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,8 @@ def _maybe_cast_slice_bound(self, label, side: str, kind=lib.no_default):
482482
483483
"""
484484
if kind not in ["loc", "getitem", None, lib.no_default]:
485-
raise ValueError('Value for kind argument must be one of: loc, getitem or None')
485+
raise ValueError('Value for kind argument must be one of: '
486+
'loc, getitem or None')
486487
self._deprecated_arg(kind, "kind", "_maybe_cast_slice_bound")
487488

488489
if isinstance(label, datetime):

pandas/core/indexes/timedeltas.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ def _maybe_cast_slice_bound(self, label, side: str, kind=lib.no_default):
193193
label : object
194194
"""
195195
if kind not in ["loc", "getitem", None, lib.no_default]:
196-
raise ValueError('Value for kind argument must be one of: loc, getitem or None')
196+
raise ValueError('Value for kind argument must be one of: '
197+
'loc, getitem or None')
197198
self._deprecated_arg(kind, "kind", "_maybe_cast_slice_bound")
198199

199200
if isinstance(label, str):

pandas/tseries/holiday.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,11 @@ def dates(
312312
return Series(self.name, index=holiday_dates)
313313
return holiday_dates
314314

315-
def _reference_dates(self, start_date: TimestampConvertibleTypes, end_date: TimestampConvertibleTypes):
315+
def _reference_dates(
316+
self,
317+
start_date: TimestampConvertibleTypes,
318+
end_date: TimestampConvertibleTypes
319+
):
316320
"""
317321
Get reference dates for the holiday.
318322

0 commit comments

Comments
 (0)