Skip to content
Closed
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
12 changes: 10 additions & 2 deletions sdk/python/feast/infra/offline_stores/file_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,19 @@ def get_table_column_names_and_types(
"AWS_ENDPOINT_URL": str(self.s3_endpoint_override),
}

schema = (
delta_schema = (
DeltaTable(self.path, storage_options=storage_options)
.schema()
.to_pyarrow()
)
if hasattr(delta_schema, "to_arrow"):
# deltalake >= 0.10.0
arro3_schema = delta_schema.to_arrow()
schema = pyarrow.schema(arro3_schema)
elif hasattr(delta_schema, "to_pyarrow"):
# deltalake < 0.10.0
schema = delta_schema.to_pyarrow()
else:
raise Exception(f"Unknown DeltaTable package version")
else:
raise Exception(f"Unknown FileFormat -> {self.file_format}")

Expand Down