Skip to content

Commit

Permalink
get tests to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
bitner committed Sep 16, 2024
1 parent f30ba2d commit b5f751d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions tipg/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,8 +910,8 @@ async def get_collection_index( # noqa: C901
) -> Catalog:
"""Fetch Table and Functions index."""
schemas = schemas or ["public"]
PostgresSettings()
query = """
pg_settings = PostgresSettings()
query = f"""
SELECT {pg_settings.tipg_schema}.tipg_catalog(
:schemas,
:tables,
Expand Down Expand Up @@ -940,7 +940,6 @@ async def get_collection_index( # noqa: C901
spatial_extent=spatial_extent,
datetime_extent=datetime_extent,
)
PostgresSettings()
catalog: Dict[str, Collection] = {}
table_settings = TableSettings()
table_confs = table_settings.table_config
Expand All @@ -951,7 +950,7 @@ async def get_collection_index( # noqa: C901
table_id = table["schema"] + "." + table["name"]
confid = table["schema"] + "_" + table["name"]

if table_id == "{pg_settings.tipg_schema}.tipg_catalog":
if table_id.split(".").pop() == "tipg_catalog":
continue

table_conf = table_confs.get(confid, TableConfig())
Expand Down
2 changes: 1 addition & 1 deletion tipg/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class PostgresSettings(BaseSettings):

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

tipg_schema: str = Field("pg_temp", regex=r"[a-zA-Z][a-zA-Z0-9_-]*")
tipg_schema: str = Field("pg_temp", pattern=r"[a-zA-Z][a-zA-Z0-9_-]*")

# https://github.com/tiangolo/full-stack-fastapi-postgresql/blob/master/%7B%7Bcookiecutter.project_slug%7D%7D/backend/app/app/core/config.py#L42
@field_validator("database_url", mode="before")
Expand Down

0 comments on commit b5f751d

Please sign in to comment.