Closed martianboy closed 7 years ago
Thank you. As briefly mentioned on the Gitter channel, this looks like a part of bigger change. Let's discuss it in #401.
We should move towards the "string" oriented, light-weight cells that are checked against model in the query builder. The #408 describes the proposed changes in more details.
I'll merge this if we use strings instead of objects such as Dimension.
Problem is that the dimension is used indirectly mostly in the browser. Quick grep and usage tracing in the source reveals:
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 remvoedCell.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.@Stiivi Cell.contains_level
is used in Drilldown.high_cardinality_levels
. And as for query/browser.py
, you're right. These functions depend on cell.cube
. Then should we pass cube
directly to Drilldown
and other functions?
For now, I just changed dimension and hierarchy properties in Cut
s to string.
@martianboy Thank you for the changes. This still needs some work, but this change is great start.
Re: pass cube to Drilldown
yes if we stay with current structures.
It's only used to convert dimension name to Dimension object, which is not necessary anymore.