Skip to content

Commit

Permalink
Tweak to fix combination of lazy+ipc features (#2099)
Browse files Browse the repository at this point in the history
Previously SerReader trait would be missing unless parquet was also active
  • Loading branch information
dbr committed Dec 21, 2021
1 parent 49e0fa3 commit 3dc2264
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion polars/polars-lazy/src/logical_plan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use polars_core::prelude::*;
#[cfg(feature = "csv-file")]
use polars_io::csv_core::utils::infer_file_schema;
#[cfg(feature = "parquet")]
use polars_io::{parquet::ParquetReader, SerReader};
use polars_io::parquet::ParquetReader;

use crate::logical_plan::LogicalPlan::DataFrameScan;
use crate::utils::{
Expand Down Expand Up @@ -824,6 +824,8 @@ impl LogicalPlanBuilder {
n_rows: Option<usize>,
cache: bool,
) -> Result<Self> {
use polars_io::SerReader as _;

let path = path.into();
let file = std::fs::File::open(&path)?;
let schema = Arc::new(ParquetReader::new(file).schema()?);
Expand All @@ -843,6 +845,8 @@ impl LogicalPlanBuilder {
#[cfg(feature = "ipc")]
#[cfg_attr(docsrs, doc(cfg(feature = "ipc")))]
pub fn scan_ipc<P: Into<PathBuf>>(path: P, options: IpcOptions) -> Result<Self> {
use polars_io::SerReader as _;

let path = path.into();
let file = std::fs::File::open(&path)?;
let schema = Arc::new(IpcReader::new(file).schema()?);
Expand Down

0 comments on commit 3dc2264

Please sign in to comment.