tlc.core.objects.tables.from_url.table_from_row_cache
#
A table representing another, potentially unregistered, Table type from a URL
Module Contents#
Classes#
Class |
Description |
---|---|
A table that wraps another table based on its row cache. |
API#
- class tlc.core.objects.tables.from_url.table_from_row_cache.TableFromRowCache(init_parameters: Any)#
Bases:
tlc.core.objects.tables.from_url.table_from_parquet.TableFromParquet
A table that wraps another table based on its row cache.
A
TableFromRowCache
enables a limited representation of unknown Table types that are not registered in the system. Note that the UnknownTable’s derived properties are not initialized and are only present as plain objects.The
TableFromRowCache
is not intended for direct instantiation, use theTableFromParquet
whenever explicit loading of tables from parquet files is desired. Instead, theTableFromRowCache
should be used as a utility for loading and representing tables that are not registered in the system. It offers an abstracted interface to work with these unknown table types while maintaining system integrity.The implementation is a minimal wrapper around TableFromParquet.
This
TableFromRowCache
can be used to represent other Table types as long as the following requirements are met:The object must have a row_cache_url set
The object must have row_cache_populated set
The object must have a schema set
Limitations:
Initialization:
TableFromRowCache
can only be initialized using theinit_params
as is done when calling Table.from_url or ObjectRegistry.get_or_create_object_from_url. Direct initialization is not supported. UseTableFromParquet
instead.Write Restriction: The table cannot be written to a URL since it would mean overwriting the original table and losing information therein. Again, use
TableFromParquet
if a persistent table is desired.Plain attributes: Derived attributes are not initialized and are plain objects, for example:
input_url
s are strings and not Url objects.
- Parameters:
init_parameters – The parameters to initialize the object with.
- Parameters:
url – The URL of the table.
created – The creation time of the table.
description – The description of the table.
row_cache_url – The URL of the row cache.
row_cache_populated – Whether the row cache is populated.
override_table_rows_schema – The schema to override the table rows schema.
init_parameters – The initial parameters of the table.
- static can_create_from_content(parameters: Any) type[tlc.core.object.Object] | None #
Determines whether a
TableFromRowCache
can be created from the given parameters.This can be used to determine whether a serialized Table of another type can be represented as a
TableFromRowCache
. The following is required:The table must have a row_cache_url set
The table must have a row_cache_populated set
The table must have a schema set
- Parameters:
parameters – The parameters to check.
- Returns:
The type of the object that can be created from the given parameters, or None if no object can be created.
- abstract write_to_url(force: bool = False) tlc.core.url.Url #