ankane/ruby-polars

`read_database` does not allow you to pass in a schema

Closed this issue · 1 comments

Sometimes the type of the fields that come back from a database query are not exactly what you want in the final DataFrame. it would be nice if read_database could take in a schema argument which would then get fowarded to the DataFrame.new call internally.

Hi @pstalcup, thanks for the suggestion. Added a schema_overrides option in the commit above (already in Python).

df = Polars.read_database("SELECT id FROM users ORDER BY id", schema_overrides: {"id" => Polars::Int16})