Fix pipeline: changed bounds in densify (all tests passed)

This commit is contained in:
itqop 2024-02-27 23:24:45 +03:00
parent 3395c36e8d
commit dbfb6ed9fd
1 changed files with 4 additions and 2 deletions

View File

@ -20,7 +20,7 @@ async def aggregate_salaries(collection: AsyncIOMotorCollection, dt_from: str, d
"step": 1,
"unit": group_type,
"bounds": [
iso(dt_from), iso(dt_upto)
iso(dt_from), iso(dt_upto) + dt.timedelta(days=int(group_type=="day"), hours=int(group_type=="hour")) * (iso(dt_upto).time() == dt.time(hour=0, minute=0, second=0))
]
}
}
@ -57,3 +57,5 @@ async def aggregate_salaries(collection: AsyncIOMotorCollection, dt_from: str, d
def iso(date: str) -> dt.datetime:
return dt.datetime.fromisoformat(date)