Type Annotations (Python 3.6)
Add type annotations and remove all unnecessary type ambiguity.
This is backward incompatible change and will make Cubes depend on Python ≧3.6. Lower versions of python will not be supported.
Annotate:
- [x] Workspace
- [x] Stores
- [ ] Metadata
- [x] Dimension
- [x] Cube
- [x] Attributes
- [ ] Providers
- [ ] Base
- [ ] Query
- [x] Browser
- [x] Cell
- [x] Result
- [x] Drilldown
- [ ] Computation
- [ ] Statutils
- [ ] SQL query builder
- [x] Browser
- [ ] Expressions
- [x] Functions
- [ ] Logging
- [x] Mapper
- [x] Query
- [x] Store
- [ ] Utils
- [x] Mapper
- [x] Errors
- [x] Logging
- [x] Calendar
- [x] Datastructures
- [x] Namespace
- [ ] Formatters
- [ ] Ext
- [ ] Slicer tool
- [ ] Auth
- [ ] Common
Tech debt
The following list is being updated as annotations are added.
- [ ] There is temporary
_ValueType,_CalculatorFunction,_RecordTypetype in statutils.py - [ ]
HierarchyPathneeds to be revisited (see also #409) - [ ]
_OrderTypeand_OrderArgType(see also #395)
Good to see that :+1:
On the client side I had to rewrite the cubes.js lib in typescript just to get static type checking. Good to have it here, too. 👍🏼
@martianboy Is that cube.js in typescript open-sourceable?
@Stiivi Yes. It needs a bit of polishing and removing a few dependencies. Will publish it in a day or two.
Collection of non-intuitive types discovered during this process.
This change is needed in MyPy Typeshed to progress further with annotations of SQL browser.
More typeshed updates to come for the query builder.
Removed server from the list of needed packages as it now lives in it's own repo: https://github.com/DataBrewery/slicer-flask.
See separated issue: DataBrewery/slicer-flask#1