InMemorySource type: None#
- class lumen.sources.base.InMemorySource(*, tables, cache_dir, cache_per_query, cache_with_dask, root, shared, name)#
InMemorySource can be used to work with in-memory data.
Parameters#
type: dict
default: {}
Methods#
- InMemorySource.add_table(name, table)#
- InMemorySource.clear_cache(*events: Event)#
Clears any cached data.
- InMemorySource.get(table: str, **query) DataFrame #
Return a table; optionally filtered by the given query.
- Parameters:
table (str) – The name of the table to query
query (dict) – A dictionary containing all the query parameters
- Returns:
A DataFrame containing the queried table.
- Return type:
DataFrame
- InMemorySource.get_schema(table: str | None = None, limit: int | None = None) dict[str, dict[str, Any]] | dict[str, Any] #
Returns JSON schema describing the tables returned by the Source.
- Parameters:
table (str | None) – The name of the table to return the schema for. If None returns schema for all available tables.
limit (int | None) – Limits the number of rows considered for the schema calculation
- Returns:
JSON schema(s) for one or all the tables.
- Return type:
dict
- InMemorySource.get_tables() list[str] #
Returns the list of tables available on this source.
- Returns:
The list of available tables on this source.
- Return type:
list
- InMemorySource.to_spec(context: dict[str, Any] | None = None) dict[str, Any] #
Exports the full specification to reconstruct this component.
- Return type:
Resolved and instantiated Component object