DataBrewery / cubes

[NOT MAINTAINED] Light-weight Python OLAP framework for multi-dimensional data analysis
http://cubes.databrewery.org
Other
1.49k stars 312 forks source link

Add record, dimension value measure value data types #410

Open Stiivi opened 7 years ago

Stiivi commented 7 years ago

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

Affected

See also

Stiivi commented 7 years ago

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