Skip to content

Commit c6d227a

Browse files
Yuri ZmytrakovYuri Zmytrakov
authored andcommitted
dummy commit
1 parent ec928c0 commit c6d227a

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

stac_fastapi/core/stac_fastapi/core/core.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,13 @@ async def get_search(
439439
"q": q,
440440
}
441441

442+
print("datetime:", datetime)
443+
442444
if datetime:
443445
base_args["datetime"] = format_datetime_range(date_str=datetime)
444446

447+
print("get_search: base_args[datetime]", base_args["datetime"])
448+
445449
if intersects:
446450
base_args["intersects"] = orjson.loads(unquote_plus(intersects))
447451

@@ -499,6 +503,8 @@ async def post_search(
499503

500504
search = self.database.make_search()
501505

506+
# print("search_request: ", search_request)
507+
502508
if search_request.ids:
503509
search = self.database.apply_ids_filter(
504510
search=search, item_ids=search_request.ids

stac_fastapi/core/stac_fastapi/core/datetime_utils.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,44 @@ def normalize(dt):
3535
return f"{normalize(start)}/{normalize(end)}"
3636

3737

38+
# def format_datetime_range(date_str: str) -> str:
39+
# """
40+
# Convert a datetime range string while preserving millisecond precision.
41+
# """
42+
# if not isinstance(date_str, str):
43+
# return "../.."
44+
45+
# # If it's already a range with "..", return as-is to preserve precision
46+
# if "/" in date_str and ".." in date_str:
47+
# return date_str # <-- PRESERVE original format like "../2025-07-16T00:24:19.000Z"
48+
49+
# # Only apply normalization for closed ranges without ".."
50+
# if "/" not in date_str:
51+
# # Single datetime - normalize with precision
52+
# return normalize(date_str)
53+
54+
# # For closed ranges (start/end without ".."), normalize both parts
55+
# try:
56+
# start, end = date_str.split("/", 1)
57+
# return f"{normalize(start)}/{normalize(end)}"
58+
# except Exception:
59+
# return "../.."
60+
61+
62+
# def normalize(dt):
63+
# dt = dt.strip()
64+
# if not dt or dt == "..":
65+
# return ".."
66+
# dt_obj = rfc3339_str_to_datetime(dt)
67+
# dt_utc = dt_obj.astimezone(timezone.utc)
68+
69+
# # PRESERVE MILLISECONDS
70+
# if dt_obj.microsecond > 0:
71+
# return dt_utc.isoformat(timespec='milliseconds').replace('+00:00', 'Z')
72+
# else:
73+
# return dt_utc.strftime("%Y-%m-%dT%H:%M:%SZ")
74+
75+
3876
# Borrowed from pystac - https://github.com/stac-utils/pystac/blob/f5e4cf4a29b62e9ef675d4a4dac7977b09f53c8f/pystac/utils.py#L370-L394
3977
def datetime_to_str(dt: datetime, timespec: str = "auto") -> str:
4078
"""Convert a :class:`datetime.datetime` instance to an ISO8601 string in the `RFC 3339, section 5.6.

stac_fastapi/opensearch/stac_fastapi/opensearch/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def run() -> None:
159159
"stac_fastapi.opensearch.app:app",
160160
host=settings.app_host,
161161
port=settings.app_port,
162-
log_level="info",
162+
log_level="debug",
163163
reload=settings.reload,
164164
)
165165
except ImportError:

stac_fastapi/opensearch/stac_fastapi/opensearch/database_logic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ async def execute_search(
520520
"""
521521
search_body: Dict[str, Any] = {}
522522
query = search.query.to_dict() if search.query else None
523-
523+
# print("query: ", query)
524524
index_param = await self.async_index_selector.select_indexes(
525525
collection_ids, datetime_search
526526
)

0 commit comments

Comments
 (0)