Skip to content

Commit

Permalink
AnyValue
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jun 5, 2024
1 parent a4ec5af commit 40219f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/polars-core/src/series/any_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ fn any_values_to_decimal(
continue;
} else {
polars_bail!(
ComputeError: "unable to convert any-value of dtype {} to decimal", av.dtype(),
SchemaMismatch: "unable to convert any-value of dtype {} to decimal", av.dtype(),
);
};
scale_range = match scale_range {
Expand All @@ -448,7 +448,7 @@ fn any_values_to_decimal(
// Scale is provided but is lower than actual.
// TODO: Do we want lossy conversions here or not?
polars_bail!(
ComputeError:
SchemaMismatch:
"unable to losslessly convert any-value of scale {s_max} to scale {}", scale,
);
}
Expand All @@ -473,7 +473,7 @@ fn any_values_to_decimal(
} else {
let factor = 10_i128.pow((scale - s_av) as _); // this cast is safe
builder.append_value(v.checked_mul(factor).ok_or_else(|| {
polars_err!(ComputeError: "overflow while converting to decimal scale {}", scale)
polars_err!(SchemaMismatch: "overflow while converting to decimal scale {}", scale)
})?);
}
}
Expand Down Expand Up @@ -723,7 +723,7 @@ fn any_values_to_object(
AnyValue::Object(val) => builder.append_value(val.as_any()),
AnyValue::Null => builder.append_null(),
_ => {
polars_bail!(ComputeError: "expected object");
polars_bail!(SchemaMismatch: "expected object");
},
}
}
Expand Down

0 comments on commit 40219f8

Please sign in to comment.