Last active
March 19, 2017 20:31
-
-
Save Stiivi/dd2ed5bf6f3f63ef2e35255fa9468fe3 to your computer and use it in GitHub Desktop.
Cubes non-intuitive data types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following data types were discovered in Cubes while type-annotating the source code. | |
# Sometimes it might seemed a good idea to permit people pass whatever they want, however opens | |
# way too many possibilities for unchecked errors. | |
# | |
# Type that can be passed as drilldown to the browser's `aggregate()` function: | |
# | |
_DrilldownType = Union[ | |
Drilldown, | |
Dict[str, Union[Dimension, str]], | |
List[ | |
Union[ | |
str, | |
DrilldownItem, | |
Dimension, | |
Tuple[ | |
Union[Dimension, str], | |
Union[Hierarchy, str], | |
Union[Level,str] | |
] | |
] | |
] | |
] | |
# distilled_hierarchies | |
# | |
_ = Dict[Tuple[str,Optional[str]],List[str]] | |
# Type that can be passed as rollup to the cell: | |
# | |
_ = Union[str, List[str], Dict[str,str]] | |
# Order types in browser's prepare_order(): | |
_OrderType = Tuple[AttributeBase,str] | |
_OrderArgType = Union[str, Union[_OrderType, Tuple[str,str]]] | |
# Report return type: | |
_ = Dict[str, Union[AggregationResult, Facts, JSONType]] | |
# SQL Joins in JSON | |
# | |
_JoinKeyFreeType = Union[ | |
Optional[str], | |
Tuple[str], | |
Tuple[Optional[str], str], | |
Tuple[Optional[str], Optional[str], str], | |
Mapping[str, str], | |
JoinKey, | |
] | |
_JoinFreeType = Union[ | |
Tuple[_JoinKeyFreeType, _JoinKeyFreeType], | |
Tuple[_JoinKeyFreeType, _JoinKeyFreeType, str], | |
Tuple[_JoinKeyFreeType, _JoinKeyFreeType, str, str], | |
Mapping[str, str], | |
Join, | |
] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment