Skip to content

Commit

Permalink
fix: Use pyarrow in a way that works across versions (#3562)
Browse files Browse the repository at this point in the history
Signed-off-by: Achal Shah <[email protected]>
  • Loading branch information
achals authored Mar 24, 2023
1 parent ebb36d5 commit 1289f3f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sdk/python/feast/infra/offline_stores/file_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@ def get_table_column_names_and_types(
# Adding support for different file format path
# based on S3 filesystem
if filesystem is None:
schema = ParquetDataset(path).schema.to_arrow_schema()
schema = ParquetDataset(path).schema
if hasattr(schema, "names") and hasattr(schema, "types"):
# Newer versions of pyarrow doesn't have this method,
# but this field is good enough.
pass
else:
schema = schema.to_arrow_schema()
else:
schema = ParquetDataset(path, filesystem=filesystem).schema

Expand Down

0 comments on commit 1289f3f

Please sign in to comment.