When performing a tables.list operation, it seems that the server returns the empty string "" instead of None as documented in the spec.
On a default run of unity catalog:
!pip install unitycatalog
import unitycatalog
client = unitycatalog.Unitycatalog(base_url="http://127.0.0.1:8080/api/2.1/unity-catalog/")
response = client.tables.list(catalog_name="unity", schema_name="default")
# assert response.next_page_token is None, f"This will fail, with a non-empty token: {response.next_page_token}"
response = client.tables.list(catalog_name="unity", schema_name="default", page_token=response.next_page_token)
# assert len(response.tables) > 0, "This will fail, because response has no tables"
# assert response.next_page_token is None, f"This will fail, with empty token: {response.next_page_token}"
This led to an unexpected infinite loop on my client-side code! Expected behavior: return null for the token when the page stream is exhausted.
When performing a tables.list operation, it seems that the server returns the empty string
""
instead of None as documented in the spec.On a default run of unity catalog:
This led to an unexpected infinite loop on my client-side code! Expected behavior: return
null
for the token when the page stream is exhausted.