robertzk / cachemeifyoucan

An R caching layer
MIT License
7 stars 7 forks source link

Safe columns #112

Closed peterhurford closed 9 years ago

peterhurford commented 9 years ago

Many times when new columns are discovered in the cache, this is not a good thing. Instead, it is indicative of cache invalidation issues! Now we can safeguard against that with safe_columns = TRUE.

If safe_columns = TRUE on your caching layer and if a call would add more columns while columns already exist, it stops with an error. If you want to cache it, you'll have to drop the entire cache and start fresh (which should be happening if column additions are happening).

If safe_columns is a function, that custom function will be called, so you can do interactive debugging.

robertzk commented 9 years ago

Thanks for the test coverage.