GSS-Cogs / databaker

Command line tool to convert spreadsheets to databases, made for the UK's Office for National Statistics.
Other
1 stars 0 forks source link

databaker: cache looksups for preview+extraction #22

Open mikeAdamss opened 3 years ago

mikeAdamss commented 3 years ago

the preview functionality works by basically doing all the lookups.

currently, we then we get to aspandas() and repeat exactly the same series of lookups.

give the new "engine" classes persist, we can probably add a dictionary to cache the results within each dimension engine (eg store{obs_cell: (looked_up_cell, looked_up_cell_value)}) every time we successfully lookup something to save us the processing overhead of repeating ourselves.

remember this needs to be cached after cellvalueoverrides, but the cache needs looking at as soon as we enter def lookup() (I think, something along those lines).