@@ -1219,8 +1219,7 @@ def infer_dtype(value: object, skipna: object=None) -> str:
1219
1219
return value
1220
1220
1221
1221
# its ndarray like but we can't handle
1222
- raise ValueError (" cannot infer type for {typ}"
1223
- .format(typ = type (value)))
1222
+ raise ValueError (f" cannot infer type for {type(value)}" )
1224
1223
1225
1224
else :
1226
1225
if not isinstance (value, list ):
@@ -1497,9 +1496,8 @@ cdef class Validator:
1497
1496
return self .is_valid(value) or self .is_valid_null(value)
1498
1497
1499
1498
cdef bint is_value_typed(self , object value) except - 1 :
1500
- raise NotImplementedError (
1501
- ' {typ} child class must define is_value_typed'
1502
- .format(typ = type (self ).__name__))
1499
+ raise NotImplementedError (f' {type(self).__name__} child class '
1500
+ f' must define is_value_typed' )
1503
1501
1504
1502
cdef bint is_valid_null(self , object value) except - 1 :
1505
1503
return value is None or util.is_nan(value)
@@ -1635,9 +1633,8 @@ cdef class TemporalValidator(Validator):
1635
1633
return self .is_value_typed(value) or self .is_valid_null(value)
1636
1634
1637
1635
cdef bint is_valid_null(self , object value) except - 1 :
1638
- raise NotImplementedError (
1639
- ' {typ} child class must define is_valid_null'
1640
- .format(typ = type (self ).__name__))
1636
+ raise NotImplementedError (f' {type(self).__name__} child class '
1637
+ f' must define is_valid_null' )
1641
1638
1642
1639
cdef inline bint is_valid_skipna(self , object value) except - 1 :
1643
1640
cdef:
@@ -1926,7 +1923,7 @@ def maybe_convert_numeric(ndarray[object] values, set na_values,
1926
1923
seen.float_ = True
1927
1924
except (TypeError , ValueError ) as e:
1928
1925
if not seen.coerce_numeric:
1929
- raise type (e)(str (e) + " at position {pos} " .format( pos = i) )
1926
+ raise type (e)(str (e) + f " at position {i} " )
1930
1927
elif " uint64" in str (e): # Exception from check functions.
1931
1928
raise
1932
1929
0 commit comments