Here is some code that triggers an error, when it seems pretty clear that it should not trigger an error.
require 'polars-df'
df = Polars::DataFrame.new([
{code: '7A', desc: "happy"},
{code: '8A', desc: "sad"},
{code: '7C', desc: "in-between"}
])
# The following line will work.
puts df.filter(Polars.col('code').str.starts_with('7'))
# The following line will cause an exception:
# invalid series dtype: expected `String`, got `binary` (Polars::Error)
puts df.filter(Polars.col('code').str.starts_with(7.to_s))
Here is the beginning of my gem env. Also: I am using polars-df (0.14.0 arm64-darwin) via Rubygems.
Thank you. Is there any chance of giving a clearer error message when this happens? It's weird to pass a string to a method and get an error message saying "expecting String".
Here is some code that triggers an error, when it seems pretty clear that it should not trigger an error.
Here is the beginning of my
gem env
. Also: I am usingpolars-df (0.14.0 arm64-darwin)
via Rubygems.