Skip to content

Commit

Permalink
typecheck arrow objects before sending to Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
wjones127 committed May 30, 2023
1 parent 5aff44e commit fa659ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions python/python/lance/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@ def _commit(
"""
if isinstance(base_uri, Path):
base_uri = str(base_uri)
if not isinstance(new_schema, pa.Schema):
raise TypeError(f"schema must be pyarrow.Schema, got {type(new_schema)}"
_Dataset.commit(base_uri, new_schema, fragments)
return LanceDataset(base_uri)

Expand Down
2 changes: 1 addition & 1 deletion python/python/lance/fragment.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def add_columns(
return updater.finish()

@property
def schema(self):
def schema(self) -> pa.Schema:
"""Return the schema of this fragment."""

return self._fragment.schema()
Expand Down

0 comments on commit fa659ef

Please sign in to comment.