ropensci / rb3

A bunch of downloaders and parsers for data delivered from B3
https://docs.ropensci.org/rb3/
Other
71 stars 28 forks source link

Don't cache NULL data read_marketdata returns #52

Closed wilsonfreitas closed 2 years ago

wilsonfreitas commented 2 years ago

read_marketdata returns NULL when downloaded data is invalid. In this situation the download data is cached and the parsed data, in this case NULL, is also cached. Actually NULL is being cached in a rds file and the invalid downloaded file is also cached.

If read_marketdata returns NULL, the rds file can't be created and the given file, input file, should be removed either.

Simply, don't cache invalid or incorrect data.

wilsonfreitas commented 2 years ago

Done!