From 01b5994cc349f12dc5eec1a226dd77694a7a0a4e Mon Sep 17 00:00:00 2001 From: Will Jones Date: Fri, 28 Apr 2023 17:03:40 -0700 Subject: [PATCH] remove old json function --- python/src/lib.rs | 12 ------------ python/src/schema.rs | 3 ++- rust/src/test_utils.rs | 4 ++-- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/python/src/lib.rs b/python/src/lib.rs index ad57f7f647..19f594391d 100644 --- a/python/src/lib.rs +++ b/python/src/lib.rs @@ -321,18 +321,6 @@ impl RawDeltaTable { .collect()) } - pub fn arrow_schema_json(&self) -> PyResult { - let schema = self - ._table - .get_schema() - .map_err(PyDeltaTableError::from_raw)?; - serde_json::to_string( - &>::try_from(schema) - .map_err(PyDeltaTableError::from_arrow)?, - ) - .map_err(|_| PyDeltaTableError::new_err("Got invalid table schema")) - } - pub fn update_incremental(&mut self) -> PyResult<()> { rt()? .block_on(self._table.update_incremental(None)) diff --git a/python/src/schema.rs b/python/src/schema.rs index 1be4988ec4..02f62136f5 100644 --- a/python/src/schema.rs +++ b/python/src/schema.rs @@ -1025,6 +1025,7 @@ impl PySchema { .map_err(|err: ArrowError| PyException::new_err(err.to_string()))?; fn convert_to_large_type(field: ArrowFieldRef, dt: ArrowDataType) -> ArrowFieldRef { + let field = field.as_ref().clone(); match dt { ArrowDataType::Utf8 => field.with_data_type(ArrowDataType::LargeUtf8).into(), @@ -1065,7 +1066,7 @@ impl PySchema { .into() } - _ => field, + _ => field.into(), } } diff --git a/rust/src/test_utils.rs b/rust/src/test_utils.rs index 56f5508078..865e16cb5f 100644 --- a/rust/src/test_utils.rs +++ b/rust/src/test_utils.rs @@ -473,7 +473,7 @@ pub mod hdfs_cli { pub fn create_dir(dir_name: impl AsRef) -> std::io::Result { let path = hdfs_cli_path(); - let mut child = Command::new(&path) + let mut child = Command::new(path) .args([ "dfs", "-mkdir", @@ -487,7 +487,7 @@ pub mod hdfs_cli { pub fn delete_dir(dir_name: impl AsRef) -> std::io::Result { let path = hdfs_cli_path(); - let mut child = Command::new(&path) + let mut child = Command::new(path) .args([ "dfs", "-rm",