fix: correct WorldQuant daily alpha date filters
Deploy production / deploy (push) Successful in 52s
Deploy production / deploy (push) Successful in 52s
This commit is contained in:
@@ -350,9 +350,13 @@ class WqClient:
|
||||
# Daily intervals are [UTC midnight, next midnight). Submitted dates
|
||||
# use the actual submission time, independently of creation or stage.
|
||||
field = "dateCreated" if submission == "UNSUBMITTED" else "dateSubmitted"
|
||||
params.update({f"{field}>=": date_from, f"{field}<": date_to, "order": field})
|
||||
# BRAIN treats the query separator '=' as part of its comparison
|
||||
# syntax: a '>=' key adds an extra '=' and makes the date invalid.
|
||||
# Both bounds are inclusive upstream; exclude the next UTC midnight.
|
||||
upper = (datetime.fromisoformat(date_to) - timedelta(microseconds=1)).isoformat()
|
||||
params.update({f"{field}>": date_from, f"{field}<": upper, "order": field})
|
||||
if field == "dateCreated":
|
||||
params["dateCreated<"] = min(before, date_to)
|
||||
params["dateCreated<"] = min(before, upper)
|
||||
return await self.get("/users/self/alphas", params)
|
||||
|
||||
async def alpha(self, alpha_id):
|
||||
|
||||
Reference in New Issue
Block a user