From ea1a315c73eaad535cfcbb691466adef23d4eca8 Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Thu, 15 Sep 2022 12:10:26 +0100 Subject: [PATCH 1/2] Remove opening the file object Let pyarrow handle opening the path using the filesystem. Signed-off-by: Max Z --- sdk/python/feast/infra/offline_stores/file_source.py | 2 +- 1 file changed, 1 insertion(+), 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 135409ed04a..0228deb09a2 100644 --- a/sdk/python/feast/infra/offline_stores/file_source.py +++ b/sdk/python/feast/infra/offline_stores/file_source.py @@ -161,7 +161,7 @@ def get_table_column_names_and_types( schema = ParquetDataset(path).schema.to_arrow_schema() else: schema = ParquetDataset( - filesystem.open_input_file(path), filesystem=filesystem + path, filesystem=filesystem ).schema return zip(schema.names, map(str, schema.types)) From 3827806f11030c044036a2a4e96e4b4c361e47a0 Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Thu, 15 Sep 2022 17:21:18 +0100 Subject: [PATCH 2/2] fix: linting error Signed-off-by: Max Z --- sdk/python/feast/infra/offline_stores/file_source.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/python/feast/infra/offline_stores/file_source.py b/sdk/python/feast/infra/offline_stores/file_source.py index 0228deb09a2..81a83c22457 100644 --- a/sdk/python/feast/infra/offline_stores/file_source.py +++ b/sdk/python/feast/infra/offline_stores/file_source.py @@ -160,9 +160,7 @@ def get_table_column_names_and_types( if filesystem is None: schema = ParquetDataset(path).schema.to_arrow_schema() else: - schema = ParquetDataset( - path, filesystem=filesystem - ).schema + schema = ParquetDataset(path, filesystem=filesystem).schema return zip(schema.names, map(str, schema.types))