Skip to content

Commit

Permalink
fix: map date to YYYY-MM-DD format
Browse files Browse the repository at this point in the history
  • Loading branch information
hiohiohio committed Oct 28, 2024
1 parent fcf9872 commit 33a6b82
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion alpaca/common/requests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime, timezone
from datetime import date, datetime, timezone
from typing import Any
from uuid import UUID

Expand Down Expand Up @@ -52,6 +52,9 @@ def map_values(val: Any) -> Any:
val = val.replace(tzinfo=timezone.utc)
return val.isoformat()

if isinstance(val, date):
return val.isoformat()

return val

# pydantic almost has what we need by passing exclude_none to dict() but it returns:
Expand Down

0 comments on commit 33a6b82

Please sign in to comment.