When determining diffs, old and new values for a given row of data are compared using the equality operator. This does not work for objects, which would need comparison of the entire object. Further, the store currently assumes objects to be strings when generating schema.
A possible solution would be to recognise object values during schema generation, and performing a deep comparison for such values when determining diffs.
This PR consists of two parts:
refactor(store): separate number and string-related schema generation
Move number-related metric type identification into one contiguous
block; if the value is a finite number, return early with either a
year or number type, depending on the name of the metric
Similarly, move the identification of string-related types into its
own block at the end; give the type as either a string or category
depending on the number of unique values for the metric
feat(store): enable deep comparison of objects in diffs
Identify objects during schema generation
Use lodash's isEqual() to compare values if cell type is object
When determining diffs, old and new values for a given row of data are compared using the equality operator. This does not work for objects, which would need comparison of the entire object. Further, the store currently assumes objects to be strings when generating schema.
A possible solution would be to recognise object values during schema generation, and performing a deep comparison for such values when determining diffs.
This PR consists of two parts:
refactor(store): separate number and string-related schema generation
feat(store): enable deep comparison of objects in diffs
isEqual()
to compare values if cell type is object