Skip to content

Commit

Permalink
switch to orjson
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Lichtman committed Oct 24, 2024
1 parent 4489f67 commit e0d924d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pcstac/pcstac/client.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import json
import logging
import time
from typing import Any, List, Optional, Type
from urllib.parse import urljoin

import attr
import orjson
from fastapi import HTTPException, Request
from stac_fastapi.pgstac.core import CoreCrudClient
from stac_fastapi.types.errors import NotFoundError
Expand Down Expand Up @@ -220,7 +220,8 @@ async def _fetch() -> ItemCollection:
if (
search_request.collections is None
and "collection=" not in str(request.url)
and '{"property": "collection"}' not in json.dumps(search_request.filter)
and '{"property":"collection"}'
not in orjson.dumps(search_request.filter).decode("utf-8")
):
raise HTTPException(status_code=422, detail="collection is required")

Expand Down

0 comments on commit e0d924d

Please sign in to comment.