Skip to content

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke committed Nov 27, 2024
1 parent fcef8cb commit 38ad168
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions python/cudf/cudf/core/column/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -5948,7 +5948,7 @@ def __contains__(self, item: ScalarLike) -> bool:

def as_numerical_column(self, dtype: Dtype) -> NumericalColumn:
out_dtype = cudf.api.types.dtype(dtype)
if out_dtype == "b":
if out_dtype.kind == "b":
with acquire_spill_lock():
plc_column = plc.strings.attributes.count_characters(
self.to_pylibcudf(mode="read")
Expand Down Expand Up @@ -6024,11 +6024,10 @@ def strptime(
add_back_nat = False

with acquire_spill_lock():
plc_dtype = dtype_to_pylibcudf_type(self.dtype)
plc_dtype = dtype_to_pylibcudf_type(dtype)
result_col = type(self).from_pylibcudf(
casting_func(self.to_pylibcudf(mode="read"), plc_dtype, format)
)
result_col = casting_func(self, dtype, format)

if add_back_nat:
result_col[is_nat] = None
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/core/tools/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ def _convert_str_col(col, errors, _downcast=None):
return col.astype(dtype=cudf.dtype("float64"))
else:
if errors == "coerce":
col = col.astype(np.dtype(np.float64))
non_numerics = is_float.unary_operator("not")
col[non_numerics] = None
col = col.astype(np.dtype(np.float64))
return col
else:
raise ValueError("Unable to convert some strings to numerics.")
Expand Down

0 comments on commit 38ad168

Please sign in to comment.