teehr.LocationCrosswalkTable#
- class teehr.LocationCrosswalkTable(ev)[source]#
Bases:
BaseTable
Access methods to location crosswalks table.
Methods
distinct_values
Return distinct values for a column.
Get the location crosswalk fields enum.
fields
Return table columns as a list.
filter
Apply a filter.
Import location crosswalks from CSV file format.
Import location crosswalks 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 Crosswalk.
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 crosswalks 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_csv() or pd.read_parquet().
Notes
The TEEHR Location Crosswalk table schema includes fields:
primary_location_id
secondary_location_id
- load_parquet(in_path: Path | str, pattern: str = '**/*.parquet', field_mapping: dict | None = None, **kwargs)[source]#
Import location crosswalks 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_csv() or pd.read_parquet().
Notes
The TEEHR Location Crosswalk table schema includes fields:
primary_location_id
secondary_location_id