From 99a163c57a41ca0d62b17e7fc663108e3700174d Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Fri, 24 Mar 2023 15:32:54 -0700 Subject: [PATCH] fix: Use pyarrow in a way that works across versions (#3562) Signed-off-by: Achal Shah --- sdk/python/feast/infra/offline_stores/file_source.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sdk/python/feast/infra/offline_stores/file_source.py b/sdk/python/feast/infra/offline_stores/file_source.py index e9f3735dee..d8522fb445 100644 --- a/sdk/python/feast/infra/offline_stores/file_source.py +++ b/sdk/python/feast/infra/offline_stores/file_source.py @@ -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