cubes icon indicating copy to clipboard operation
cubes copied to clipboard

Add record, dimension value measure value data types

Open Stiivi opened this issue 9 years ago • 1 comments

Add datatypes representing database record Record, value of dimension key and numeric value of measures/aggregates. Suggestion:

MeasureValueType = Union[int, float]

DimensionValueType = Union[int, str]
# Or if we decide to support Nulls (discouraged, but people have all sorts of data out there):
DimensionValueType = Optional[Union[int, str]]

RecordValueType = Union[MeasureValueType, DimensionValueType]
# Alternative with nulls:
RecordValueType = Optional[Union[MeasureValueType, DimensionValueType]]

RecordType = Mapping[str, RecordValueType]

Questions

  • Do we allow NULLs?
  • If yes, when and how?
  • Is there a need to have two versions of Record type with Optional and not-Optional values?

Affected

  • AggregationResult.cells and .summary
  • Browser.aggregate()
  • HierarchyPath
  • SQL backend: browser and execution

See also

  • #409 – Investigate use and effects of None path values

Stiivi avatar Mar 15 '17 01:03 Stiivi

Updated description: changed names to *Type and added questions/comments about optionals/NULL values.

Stiivi avatar Mar 16 '17 17:03 Stiivi