diff --git a/python/deltalake/schema.py b/python/deltalake/schema.py index 8b4ceb7651..2f89cfaa2d 100644 --- a/python/deltalake/schema.py +++ b/python/deltalake/schema.py @@ -54,7 +54,7 @@ def dtype_to_delta_dtype(dtype: pa.DataType) -> pa.DataType: return pa.timestamp( "us" ) # TODO(ion): propagate also timezone information during writeonce we can properly read TZ in delta schema - elif isinstance(dtype, pa.FixedSizeBinaryType): + elif type(dtype) is pa.FixedSizeBinaryType: return pa.binary() try: return dtype_map[dtype] diff --git a/python/tests/test_schema.py b/python/tests/test_schema.py index faaf8f5897..7721774d21 100644 --- a/python/tests/test_schema.py +++ b/python/tests/test_schema.py @@ -236,6 +236,7 @@ def test_delta_schema(): pa.field("some_int", pa.uint32(), nullable=True), pa.field("some_string", pa.string(), nullable=False), pa.field("some_fixed_binary", pa.binary(5), nullable=False), + pa.field("some_decimal", pa.decimal128(10, 2), nullable=False), ] ), pa.schema( @@ -243,6 +244,7 @@ def test_delta_schema(): pa.field("some_int", pa.int32(), nullable=True), pa.field("some_string", pa.string(), nullable=False), pa.field("some_fixed_binary", pa.binary(), nullable=False), + pa.field("some_decimal", pa.decimal128(10, 2), nullable=False), ] ), False,