Skip to content

Commit 99a163c

Browse files
committed
fix: Use pyarrow in a way that works across versions (#3562)
Signed-off-by: Achal Shah <[email protected]>
1 parent c4e0494 commit 99a163c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sdk/python/feast/infra/offline_stores/file_source.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,13 @@ def get_table_column_names_and_types(
158158
# Adding support for different file format path
159159
# based on S3 filesystem
160160
if filesystem is None:
161-
schema = ParquetDataset(path).schema.to_arrow_schema()
161+
schema = ParquetDataset(path).schema
162+
if hasattr(schema, "names") and hasattr(schema, "types"):
163+
# Newer versions of pyarrow doesn't have this method,
164+
# but this field is good enough.
165+
pass
166+
else:
167+
schema = schema.to_arrow_schema()
162168
else:
163169
schema = ParquetDataset(path, filesystem=filesystem).schema
164170

0 commit comments

Comments
 (0)