Open Stiivi opened 7 years ago
Copy from #407: places where Cell is using Dimension object or places affected by it:
sql/query.py
uses cut dimension as str(cut.dimension)
(good)query/browser.py
is using str()
or cube lookup, which is the same (good)query/cells.py
Cell.all_attributes
which does not seem to be used anywhereCell.slice
and Cell.point_slice
which are not used anywhere except documentation and they should be moved into the new Query.Cell.drilldown
which seems not to be used and should be moved to the new QueryCell.cut_for_dimension
which is unused and should be removedCell.point_cut_for_dimension
which should be moved (see below)Cell.rollup_dim
which is unused and is a candidate for removal/move to the new QueryCell.rollup
- remove, move to the QueryCell.level_depths
– unused, to be removedCell.deepest_levels
- unused, was used for Periods-to-date, might be moved to Query?Cell.contains_level
– unused, to be removedCell.point_slice
- unused, to be removed or moved to queryCell.is_base
- unused, to be removedquery/browser.py
uses Cell.point_cut_for_dimension
AggregationResult.table_rows
levels_from_drilldown()
which sohuld receive cube as well as Drilldown
should receive a cube.
Problem
Current query flow and generation is not very transparent and there is no clear separation of concerns – which part is doing what.
AggregationBrowser
– subclassable by the backends. Has main entry pointaggregate()
with lots of arguments that need to be converted usingprepare_*()
functions.Details
Store
) repeatedlyProposed design:
Impact on Existing Code
New recommended flow of query creation will be created. Breaking changes: any construction of cells with model objects will fail For backward compatibility the
Browser
will wrap functionality of the new components.Should NOT break server API v2.
References
Depends on:
407 Remove cube from Cell
395 Change sort attribute to enum (required)
Has impact on:
403 Incomplete and broken unittests – will be easier to write the tests
Dependents:
245 Drill Across