You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I have a particular use case in which I'd like to save the last known date and rate for unknown values, to keep as a reference as to what actual rate and date were used.
def_use_last_known(self, currency):
"""Fill missing rates of a currency. This is done by using the last known rate. :param str currency: The currency to fill missing rates for. """rates=self._rates[currency]
fordateinsorted(rates):
rate=rates[date]
ifrateisnotNone:
last_rate, last_date=rate, dateelse:
rates[date] =last_rateifself.verbose:
print(
"{}: filling {} missing rate using {} from {}".format(
currency, date, last_rate, last_date
)
)
It seems the lib is simply disregarding this information atm. I'd be happy to do it myself, but how would you like it to be done?
The text was updated successfully, but these errors were encountered:
Indeed this information is not kept. If I understand correctly, what you want is a new method that for each currency and date, returns the actual date used for the rate?
A possible implementation would be to fill a self._rates_origin[currency][date] -> origin_date object with those data. We would need to either fill it will all dates, or only the cases where a fallback was done. Also both fallback methods would need to be changed.
I am not 100% sure this is needed, as this is the first time such use case is mentioned, and it would grow a bit the memory usage (also, it can be implemented in client code using subclassing).
Hey, I have a particular use case in which I'd like to save the last known date and rate for unknown values, to keep as a reference as to what actual rate and date were used.
It seems the lib is simply disregarding this information atm. I'd be happy to do it myself, but how would you like it to be done?
The text was updated successfully, but these errors were encountered: