Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyiceberg/io/pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ def primitive(self, primitive: pa.DataType) -> PrimitiveType:
elif isinstance(primitive, pa.Decimal128Type):
primitive = cast(pa.Decimal128Type, primitive)
return DecimalType(primitive.precision, primitive.scale)
elif pa.types.is_string(primitive):
elif pa.types.is_string(primitive) or pa.types.is_large_string(primitive):
return StringType()
elif pa.types.is_date32(primitive):
return DateType()
Expand Down
9 changes: 9 additions & 0 deletions tests/io/test_pyarrow_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,15 @@ def test_round_schema_conversion_nested(table_schema_nested: Schema) -> None:
assert actual == expected


def test_round_schema_large_string() -> None:
schema = pa.schema([pa.field("animals", pa.large_string())])
actual = str(pyarrow_to_schema(schema, name_mapping=NameMapping([MappedField(field_id=1, names=["animals"])])))
expected = """table {
1: animals: optional string
}"""
assert actual == expected


def test_simple_schema_has_missing_ids() -> None:
schema = pa.schema([
pa.field('foo', pa.string(), nullable=False),
Expand Down