Data Store
A DataStoreConfig reads from a stored dataset.
Filters narrow the rows that are imported.
DataStoreConfig — data source backed by a managed data store.
- class DataStoreConfig(data_store_key, tables)[source]
Data source that reads rows from a stored dataset.
Apply a
DataFilterviaset_model_filter()to restrict which rows are imported.- Parameters:
- set_model_filter(model_filter)[source]
Apply a row-level
DataFilterto narrow the rows pulled in.- Return type:
- set_using_interface(using_interface)[source]
Read through the data store’s interface layer rather than directly.
- Return type:
- set_direct_data_pull(direct_data_pull)[source]
Bypass any caching layer and pull rows directly each import.
- Return type:
- property type: DataSourceType
The
DataSourceTypediscriminator for this configuration.
Filters
Abstract DataFilter base class for row-level DataStoreConfig filters.
Concrete subclasses declare their @type discriminator via the
@json_type_info decorator, and implement type.
- class DataFilter[source]
Abstract base for typed data-store row filters.
- property type: DataFilterType
The
DataFilterTypediscriminator for this filter.
DataFilterType discriminator enum for DataFilter.
- class DataFilterType(*values)[source]
Identifies the kind of row filter applied by
DataFiltersubclasses.- Values:
EQUALITY: Match rows whose value equals a source key. INEQUALITY: Match rows whose value falls within a numeric range. SET: Match rows whose value is in a set of source keys. WILDCARD: Match rows whose value matches a glob pattern. REGEX: Match rows whose value matches a regular expression.
- EQUALITY = 'equality'
- INEQUALITY = 'inequality'
- SET = 'set'
- WILDCARD = 'wildcard'
- REGEX = 'regex'
EqualityDataFilter — a DataFilter matching exact-equality rows.
- class EqualityDataFilter(path, source_key, value=None)[source]
Match rows whose value at
pathequals the value resolved fromsource_key.- Parameters:
- property type: DataFilterType
The
DataFilterTypediscriminator for this filter.
InequalityDataFilter — a DataFilter matching numeric range rows.
- class InequalityDataFilter(path, lower_key, upper_key, lower=None, upper=None)[source]
Match rows whose numeric value at
pathfalls within a range.- Parameters:
lower_key (
float|Parameter|Calculation) – Lower bound source — a literal or model named value.upper_key (
float|Parameter|Calculation) – Upper bound source — a literal or model named value.lower (
float|None) – Optional literal lower-bound value emitted alongside the key.upper (
float|None) – Optional literal upper-bound value emitted alongside the key.
- property type: DataFilterType
The
DataFilterTypediscriminator for this filter.
RegexDataFilter — a DataFilter matching rows by regex.
- class RegexDataFilter(path, source_key, value=None)[source]
Match rows whose value at
pathmatches the regex resolved fromsource_key.- Parameters:
- property type: DataFilterType
The
DataFilterTypediscriminator for this filter.
SetDataFilter — a DataFilter matching rows by set membership.
- class SetDataFilter(path, source_keys, values=None)[source]
Match rows whose value at
pathis in a set of values resolved fromsource_keys.- Parameters:
- property type: DataFilterType
The
DataFilterTypediscriminator for this filter.
WildcardDataFilter — a DataFilter matching rows by glob pattern.
- class WildcardDataFilter(path, source_key, value=None, case_sensitive=False)[source]
Match rows whose value at
pathmatches the glob pattern resolved fromsource_key.- Parameters:
- property type: DataFilterType
The
DataFilterTypediscriminator for this filter.