To reproduce, run the code below
from onc import ONC
onc = ONC("TOKEN")
data = onc.getRawdata(
{
"deviceCategoryCode": "ACOUSTICTRANSPONDER",
"dateFrom": "2025-04-01",
"dateTo": "2025-04-20",
"locationCode": "BACSG.AT1",
},
allPages=True,
)
It happens when the dateTo is not in the format of "YYYY-MM-DDTHH:MM:SS.SSSZ" because the response automatically uses this format for dateFrom in the next value for pagination, and the datetime parsing applies timezone automatically for this format. So dateTo has no timezone but dateFrom has timezone info, making them incompatible to subtract with each other.
Also need to add a test to cover this case.