teehr.LocationAttributeTable#
- class teehr.LocationAttributeTable(ev)[source]#
Bases:
BaseTable
Access methods to location attributes table.
Methods
distinct_values
Return distinct values for a column.
Get the location attribute fields enum.
fields
Return table columns as a list.
filter
Apply a filter.
Import location_attributes from CSV file format.
Import location_attributes from parquet file format.
order_by
Apply an order_by.
query
Run a query against the table with filters and order_by.
Return GeoPandas DataFrame.
Return Pandas DataFrame for Location Attributes.
to_sdf
Return PySpark DataFrame.
validate
Validate the dataset table against the schema.
- load_csv(in_path: Path | str, pattern: str = '**/*.csv', field_mapping: dict | None = None, **kwargs)[source]#
Import location_attributes from CSV file format.
- Parameters:
in_path (
Union[Path
,str]
) – The input file or directory path. CSV file format.field_mapping (
dict
, optional) – A dictionary mapping input fields to output fields. Format: {input_field: output_field}**kwargs – Additional keyword arguments are passed to pd.read_parquet().
Notes
The TEEHR Location Attribute table schema includes fields:
location_id
attribute_name
value
- load_parquet(in_path: Path | str, pattern: str = '**/*.parquet', field_mapping: dict | None = None, **kwargs)[source]#
Import location_attributes from parquet file format.
- Parameters:
in_path (
Union[Path
,str]
) – The input file or directory path. Parquet file format.field_mapping (
dict
, optional) – A dictionary mapping input fields to output fields. Format: {input_field: output_field}**kwargs – Additional keyword arguments are passed to pd.read_parquet().
Notes
The TEEHR Location Attribute table schema includes fields:
location_id
attribute_name
value