Skip to content

Commit

Permalink
Switched to
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdiez-at committed Aug 29, 2024
1 parent c22ea2f commit a968b72
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/src/user_guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ prefix: **`TIPG_`**
- **TABLE_CONFIG_ _ {schemaId}_{tableId} _ _DATETIMECOL** (str): Table's datetime column name
- **TABLE_CONFIG_ _ {schemaId}_{tableId} _ _PK** (str): Table's primary key
- **TABLE_CONFIG_ _ {schemaId}_{tableId} _ _PROPERTIES** (list of string): Select specific properties from table (for filtering and output)
- **SORT_COLUMNS** (bool): Sort the `columns` for a table alphabetically. Default is `True`.

```bash
TIPG_TABLE_CONFIG__pgstac_items__PK=id
Expand Down Expand Up @@ -129,7 +130,6 @@ prefix: **`TIPG_`**

- **DEFAULT_FEATURES_LIMIT** (int): Set the default `Limit` values for `/items` endpoint. Default is `10`
- **MAX_FEATURES_PER_QUERY** (int): Set the maximum number of features the `/items` endpoint can return. Default is `10000`.
- **SORT_COLUMNS** (bool): Sort the `columns` for a feature alphabetically. Default is `True`.

```bash
TIPG_DEFAULT_FEATURES_LIMIT=1000 TIPG_MAX_FEATURES_PER_QUERY=2000
Expand Down
2 changes: 1 addition & 1 deletion tipg/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ async def get_collection_index( # noqa: C901

# Make sure that any properties set in conf exist in table
columns = table.get("properties", [])
if features_settings.sort_columns:
if table_settings.sort_columns:
columns = sorted(columns, key=lambda d: d["name"])

properties_setting = table_conf.properties or [c["name"] for c in columns]
Expand Down
4 changes: 2 additions & 2 deletions tipg/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ class TableSettings(BaseSettings):

fallback_key_names: List[str] = ["ogc_fid", "id", "pkey", "gid"]
table_config: Dict[str, TableConfig] = {}

sort_columns: bool = True

model_config = {
"env_prefix": "TIPG_",
"env_file": ".env",
Expand All @@ -86,7 +87,6 @@ class FeaturesSettings(BaseSettings):

default_features_limit: int = Field(10, ge=0)
max_features_per_query: int = Field(10000, ge=0)
sort_columns: bool = True

model_config = {"env_prefix": "TIPG_", "env_file": ".env", "extra": "ignore"}

Expand Down

0 comments on commit a968b72

Please sign in to comment.