Collection.serialize#

classmethod Collection.serialize() str[source]#

Serialize the metadata for this collection to a JSON string.

This method does NOT serialize any data frames, but only the _structure_ of the collection, similar to dataframely.Schema.serialize().

Returns:

The serialized collection.

Note

Serialization within dataframely itself will remain backwards-compatible at least within a major version. Until further notice, it will also be backwards-compatible across major versions.

Attention

Serialization of polars expressions and lazy frames is not guaranteed to be stable across versions of polars. This affects collections with filters or members that define custom rules or columns with custom checks: a collection serialized with one version of polars may not be deserializable with another version of polars.

Attention

This functionality is considered unstable. It may be changed at any time without it being considered a breaking change.

Raises:
  • TypeError – If a column of any member contains metadata that is not JSON-serializable.

  • ValueError – If a column of any member is not a “native” dataframely column type but a custom subclass.