Skip to content

Commit

Permalink
Impl traits for polars crate
Browse files Browse the repository at this point in the history
  • Loading branch information
pka committed Sep 3, 2023
1 parent 933d9da commit ca2b054
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ default = ["reqwest-async", "reqwest-sync"]
reqwest-async = ["reqwest"]
reqwest-sync = ["reqwest/blocking"]
ureq-sync = ["ureq"]
polars = ["ureq", "polars-io"]

[dependencies]
async-trait = "0.1.51"
byteorder = "1.4.2"
bytes = "1.0.1"
polars-io = { version = "0.32.1", features = ["parquet", "csv"], optional = true }
read-logger = "0.2.0"
reqwest = { version = "0.11.0", default-features = false, features = ["default-tls"], optional = true }
thiserror = "1.0"
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

mod buffered_range_client;
mod error;
#[cfg(feature = "polars")]
mod polars;
mod range_client;
#[cfg(any(feature = "reqwest-async", feature = "reqwest-sync"))]
mod reqwest_client;
Expand Down
5 changes: 5 additions & 0 deletions src/polars.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use crate::{SyncBufferedHttpRangeClient, SyncHttpRangeClient};
use polars_io::mmap::MmapBytesReader;

impl<T: SyncHttpRangeClient + Send + Sync> MmapBytesReader for SyncBufferedHttpRangeClient<T> {}
// Polars requires MmapBytesReader::to_bytes or to_file, which doesn't make sense for SyncHttpRangeClient

0 comments on commit ca2b054

Please sign in to comment.