From e0d924dd7b9c145806c30becfc36f76892f7b797 Mon Sep 17 00:00:00 2001 From: Marc Lichtman Date: Thu, 24 Oct 2024 14:03:28 -0400 Subject: [PATCH] switch to orjson --- pcstac/pcstac/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pcstac/pcstac/client.py b/pcstac/pcstac/client.py index 5c6d4661..dfc30eeb 100644 --- a/pcstac/pcstac/client.py +++ b/pcstac/pcstac/client.py @@ -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 @@ -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")