pola-rs / polars

Dataframes powered by a multithreaded, vectorized query engine, written in Rust
https://docs.pola.rs
Other
29.61k stars 1.89k forks source link

Support ULID column #8684

Open liamwh opened 1 year ago

liamwh commented 1 year ago

Problem description

I wish I could create a pola.rs DataFrame with a column of ULIDs from the ulid crate.

Something like this:

let ser = Series::new("ID", vec![Ulid::new(), Ulid::new()])

Gives the error: the trait bound polars::prelude::Series: polars::prelude::NamedFrom<Vec<ulid::Ulid>, _> is not satisfied Explanation: the trait polars::prelude::NamedFrom<Vec<ulid::Ulid>, _> is not implemented for polars::prelude::Series

alexander-beedie commented 1 year ago

You could create a Uft8 col from these, given that they have a stable string representation?

ritchie46 commented 1 year ago

You can use the object type for arbitrary structs, but I would advice against using that. As @alexander-beedie says it is better to chose a matching data type that fits your needs.