feat: add RemoteTable.version in Python (#644)

Please note: this is not tested as we don't have a server here and
testing against a mock object wouldn't be that interesting.
This commit is contained in:
Rok Mihevc
2023-11-13 21:43:48 +01:00
committed by Weston Pace
parent 49a366bc74
commit 32cb1b9ea4

View File

@@ -44,6 +44,14 @@ class RemoteTable(Table):
schema = json_to_schema(resp["schema"])
return schema
@property
def version(self) -> int:
"""Get the current version of the table"""
resp = self._conn._loop.run_until_complete(
self._conn._client.post(f"/v1/table/{self._name}/describe/")
)
return resp["version"]
def to_arrow(self) -> pa.Table:
"""Return the table as an Arrow table."""
raise NotImplementedError("to_arrow() is not supported on the LanceDB cloud")