Open kevinjqliu opened 7 months ago
We should be able to (de)serialize it using Pydantic. That's probably also faster.
oh thanks for the hint, looks like using the model_dump_json
function works.
from pyiceberg.catalog import load_catalog
import json
catalog = load_catalog()
tbl = catalog.load_table("default.taxi_dataset")
tbl.metadata.model_dump_json()
but only on tbl.metadata
and not tbl
.
There's already a __repr__
function defined for the Table
object. @Fokko what do you think about adding another function for Table
which will output the JSON representation?
@kevinjqliu if no one is on this, can look to take this on
@db-trin-life yep assigned to you!
Feature Request / Improvement
The REST Catalog exposes
Table
andTableMetadata
information as HTTP endpoints in JSON format (link). This information is similar to the internal state ofTable
andTableMetadata
objects in Python.It would be great to make these JSON serializable.
Example
Error