@@ -158,7 +158,7 @@ def to_date(value: TimeLike, relative_base: t.Optional[datetime] = None) -> date
158158
159159def date_dict (
160160 start : TimeLike , end : TimeLike , latest : TimeLike , only_latest : bool = False
161- ) -> t .Dict [str , t .Union [str , datetime , float , int ]]:
161+ ) -> t .Dict [str , t .Union [str , datetime , date , float , int ]]:
162162 """Creates a kwarg dictionary of datetime variables for use in SQL Contexts.
163163
164164 Keys are like start_date, start_ds, end_date, end_ds...
@@ -172,7 +172,7 @@ def date_dict(
172172 Returns:
173173 A dictionary with various keys pointing to datetime formats.
174174 """
175- kwargs : t .Dict [str , t .Union [str , datetime , float , int ]] = {}
175+ kwargs : t .Dict [str , t .Union [str , datetime , date , float , int ]] = {}
176176
177177 prefixes = [("latest" , to_datetime (latest ))]
178178
@@ -183,7 +183,8 @@ def date_dict(
183183 for prefix , time_like in prefixes :
184184 dt = to_datetime (time_like )
185185 millis = to_timestamp (time_like )
186- kwargs [f"{ prefix } _date" ] = dt
186+ kwargs [f"{ prefix } _dt" ] = dt
187+ kwargs [f"{ prefix } _date" ] = to_date (dt )
187188 kwargs [f"{ prefix } _ds" ] = to_ds (time_like )
188189 kwargs [f"{ prefix } _ts" ] = dt .isoformat ()
189190 kwargs [f"{ prefix } _epoch" ] = millis / 1000
0 commit comments