Skip to content

Commit

Permalink
Fix Python
Browse files Browse the repository at this point in the history
  • Loading branch information
kyotoYaho committed Dec 8, 2022
1 parent 932ed45 commit c2a31c2
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions python/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ impl PySessionContext {
&mut self,
name: &str,
path: &str,
table_partition_cols: Vec<(String, PyDataType)>,
table_partition_cols: Vec<(String, DataType)>,
parquet_pruning: bool,
file_extension: &str,
py: Python,
) -> PyResult<()> {
let mut options = ParquetReadOptions::default()
.table_partition_cols(convert_table_partition_cols(table_partition_cols))
.table_partition_cols(table_partition_cols)
.parquet_pruning(parquet_pruning);
options.file_extension = file_extension;
let result = self.ctx.register_parquet(name, path, options);
Expand Down Expand Up @@ -254,13 +254,4 @@ impl PySessionContext {
fn empty_table(&self) -> PyResult<PyDataFrame> {
Ok(PyDataFrame::new(self.ctx.read_empty()?))
}
}

fn convert_table_partition_cols(
table_partition_cols: Vec<(String, PyDataType)>,
) -> Vec<(String, DataType)> {
table_partition_cols
.iter()
.map(|(name, t)| (name.clone(), t.data_type.clone()))
.collect()
}

0 comments on commit c2a31c2

Please sign in to comment.