stac-fastapi-core 6.7.5__tar.gz → 6.7.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/PKG-INFO +1 -1
  2. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/core.py +6 -2
  3. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/datetime_utils.py +4 -1
  4. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/version.py +1 -1
  5. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/.gitignore +0 -0
  6. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/README.md +0 -0
  7. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/pyproject.toml +0 -0
  8. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/pytest.ini +0 -0
  9. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/__init__.py +0 -0
  10. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/base_database_logic.py +0 -0
  11. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/base_settings.py +0 -0
  12. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/basic_auth.py +0 -0
  13. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/extensions/__init__.py +0 -0
  14. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/extensions/aggregation.py +0 -0
  15. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/extensions/collections_search.py +0 -0
  16. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/extensions/fields.py +0 -0
  17. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/extensions/filter.py +0 -0
  18. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/extensions/query.py +0 -0
  19. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/models/__init__.py +0 -0
  20. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/models/links.py +0 -0
  21. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/models/search.py +0 -0
  22. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/rate_limit.py +0 -0
  23. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/redis_utils.py +0 -0
  24. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/route_dependencies.py +0 -0
  25. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/serializers.py +0 -0
  26. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/session.py +0 -0
  27. {stac_fastapi_core-6.7.5 → stac_fastapi_core-6.7.6}/stac_fastapi/core/utilities.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stac_fastapi_core
3
- Version: 6.7.5
3
+ Version: 6.7.6
4
4
  Summary: Core library for the Elasticsearch and Opensearch stac-fastapi backends.
5
5
  Project-URL: Homepage, https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch
6
6
  License: MIT
@@ -24,7 +24,6 @@ from stac_fastapi.core.base_database_logic import BaseDatabaseLogic
24
24
  from stac_fastapi.core.base_settings import ApiBaseSettings
25
25
  from stac_fastapi.core.datetime_utils import format_datetime_range
26
26
  from stac_fastapi.core.models.links import PagingLinks
27
- from stac_fastapi.core.redis_utils import redis_pagination_links
28
27
  from stac_fastapi.core.serializers import CollectionSerializer, ItemSerializer
29
28
  from stac_fastapi.core.session import Session
30
29
  from stac_fastapi.core.utilities import filter_fields, get_bool_env
@@ -426,6 +425,8 @@ class CoreClient(AsyncBaseCoreClient):
426
425
  ]
427
426
 
428
427
  if redis_enable:
428
+ from stac_fastapi.core.redis_utils import redis_pagination_links
429
+
429
430
  await redis_pagination_links(
430
431
  current_url=str(request.url),
431
432
  token=token,
@@ -790,9 +791,10 @@ class CoreClient(AsyncBaseCoreClient):
790
791
  search=search, collection_ids=search_request.collections
791
792
  )
792
793
 
794
+ datetime_parsed = format_datetime_range(date_str=search_request.datetime)
793
795
  try:
794
796
  search, datetime_search = self.database.apply_datetime_filter(
795
- search=search, datetime=search_request.datetime
797
+ search=search, datetime=datetime_parsed
796
798
  )
797
799
  except (ValueError, TypeError) as e:
798
800
  # Handle invalid interval formats if return_date fails
@@ -903,6 +905,8 @@ class CoreClient(AsyncBaseCoreClient):
903
905
  links.extend(collection_links)
904
906
 
905
907
  if redis_enable:
908
+ from stac_fastapi.core.redis_utils import redis_pagination_links
909
+
906
910
  await redis_pagination_links(
907
911
  current_url=str(request.url),
908
912
  token=token_param,
@@ -32,7 +32,10 @@ def format_datetime_range(date_str: str) -> str:
32
32
  dt_utc = MIN_DATE_NANOS
33
33
  if dt_utc > MAX_DATE_NANOS:
34
34
  dt_utc = MAX_DATE_NANOS
35
- return dt_utc.isoformat(timespec="auto").replace("+00:00", "Z")
35
+ dt_normalized = dt_utc.isoformat(timespec="auto").replace("+00:00", "Z")
36
+ if "." not in dt_normalized:
37
+ dt_normalized = dt_normalized.replace("Z", ".0Z")
38
+ return dt_normalized
36
39
 
37
40
  if not isinstance(date_str, str):
38
41
  return f"{MIN_DATE_NANOS.isoformat(timespec='auto').replace('+00:00','Z')}/{MAX_DATE_NANOS.isoformat(timespec='auto').replace('+00:00','Z')}"
@@ -1,2 +1,2 @@
1
1
  """library version."""
2
- __version__ = "6.7.5"
2
+ __version__ = "6.7.6"