-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Contribution]: Better to throw exception when future datetime is specified to endpoints for current/historical data #396
Comments
I have mixed opinions on this, so will share both reasons why I think we might want it and why not.
Why we SHOULDN'T throw an exception:
Additionally, when implementing this we need to think in which timezone and at what times the cutoff time for most recent emission is - e.g. if EMFree has a few hour delay, then requesting current time emissions might be invalid, as the most recent emission is from few hours ago. |
I think we can disallow historical endpoint never accept request for forecasting because it is for "historical".
I've raised this issue about passing future datetime to historical endpoint, so I think we don't need to think about this case.
I think your concern fits case 2 and 3, it means the SDK user specifies start datetime, so I think it can be allowed that the SDK would not return any data when emission data is out of specified time range. |
Can we please create an ADR for this as per the meeting last week on the 2023-10-10 #402 . Thanks! |
This issue has not had any activity in 120 days. Please review this issue and ensure it is still relevant. If no more activity is detected on this issue for the next 20 days, it will be closed automatically. |
Wait, do not close this issue. I will start to work when I can (maybe after clarifying |
What is next on this one please? |
This issue has not had any activity in 120 days. Please review this issue and ensure it is still relevant. If no more activity is detected on this issue for the next 20 days, it will be closed automatically. |
Please remove Priority of this issue is not high, but it is worth to discuss I think. I'll back when other issues/PRs are closed. |
This issue has not had any activity in 120 days. Please review this issue and ensure it is still relevant. If no more activity is detected on this issue for the next 20 days, it will be closed automatically. |
Please remove stale label from this issue. |
What happened?
We would receive HTTP 204 (No content) when we pass future datetime to endpoints of current/historical data (e.g. /emissions/bylocation) in WebAPI. However these endpoints would not handle forecast data, so future datetime as parameters are not expected.
We've discussed about this whether it would be better to throw exception (e.g. ArgumentOutOfRangeException) in this case in #389 and #384. If throwing exception is appropriate, we need to fix all of datasources (WattTime, ElectricityMaps, ElectricityMapsFree, JSON).
Code of Conduct
Feature Commitment
The text was updated successfully, but these errors were encountered: