Skip to content

Commit

Permalink
Remove as_physical() fallthrough for extension types.
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkzinzow committed May 18, 2023
1 parent 7cd2205 commit efaab36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/series/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl Series {
}
pub fn as_physical(&self) -> DaftResult<Series> {
let physical_dtype = self.data_type().to_physical();
if &physical_dtype == self.data_type() || self.data_type().is_extension() {
if &physical_dtype == self.data_type() {
Ok(self.clone())
} else {
self.inner.cast(&physical_dtype)
Expand Down
3 changes: 2 additions & 1 deletion tests/table/test_from_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"timestamp": pa.timestamp("us"),
}

if ARROW_VERSION >= (12, 0, 0) and get_context().runner_config.name == "ray":
if ARROW_VERSION >= (12, 0, 0) and get_context().runner_config.name != "ray":
ARROW_ROUNDTRIP_TYPES["canonical_tensor"] = pa.fixed_shape_tensor(pa.int64(), (2, 2))
ARROW_TYPE_ARRAYS["canonical_tensor"] = pa.FixedShapeTensorArray.from_numpy_ndarray(
np.array(PYTHON_TYPE_ARRAYS["tensor"])
Expand Down Expand Up @@ -158,6 +158,7 @@ def test_from_pydict_roundtrip() -> None:

def test_from_pydict_arrow_roundtrip(uuid_ext_type) -> None:
arrow_roundtrip_types, arrow_type_arrays = _with_uuid_ext_type(uuid_ext_type)
print(arrow_roundtrip_types)
table = Table.from_pydict(arrow_type_arrays)
assert len(table) == 2
assert set(table.column_names()) == set(arrow_type_arrays.keys())
Expand Down

0 comments on commit efaab36

Please sign in to comment.