ttytm/wthrr-the-weathercrab

[Bug Report] Historical Data not Available

kevinmatthes opened this issue · 5 comments

I was testing options for a solution to #132 and noticed that the application breaks if historical weather data is queried. Here are some examples:

  • wthrr London -F `date --date=tomorrow +%F`
  • wthrr London -F `date +%F`
  • wthrr London -F `date --date=yesterday +%F`
  • wthrr London -F 2023-05-07 (tomorrow)
  • wthrr London -F 2023-05-06 (today)
  • wthrr London -F 2023-05-05 (yesterday)

I understand that for future dates, there is no data to be fetched, yet. But the application offers historical weather data, so I assume that historical data should be available, at least for some places like capital cities and for dates in the past. As a core functionality of the application does not work, I consider this bug critical.

This bug also appears in v1.0.0; cargo install wthrr --version 1.0.0.

The weather of "last year" is no problem but "yesterday" is.

ttytm commented

Thanks for the report @kevinmatthes,

Yes this should definitively be fixed. I'm looking into it this sunday.

ttytm commented

Unfortunately this is due to an api limitation. It takes some days until historical data is available in the archive. I'm observing 3-5 days delay for the places I've checked.

E.g., checking on on 2023-06-23 for Berlin: the 2023-06-20 temperature data has null values, while it's available for 06-19.
https://archive-api.open-meteo.com/v1/archive?latitude=52.52&longitude=13.41&start_date=2023-06-20&end_date=2023-06-20&hourly=temperature_2m&daily=temperature_2m_mean&timezone=Europe%2FBerlin

I'll add a proper error information for requests that encounter historical null data that the weather data isn't available.

ttytm commented

In the meantime, a real solution for the issue became available. open-meteo provides now a &past_days endpoint in their forecast API, to include recent days. This we can use to access recently past days. It's what should be and is gonna be used for the updated fix.