Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cubes/metadata/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def localized(self, context):
for obj in getattr(acopy, attr):
obj_context = context.object_localization(attr, obj.name)
list_copy.append(obj.localized(obj_context))
setattr(acopy, attr, list_copy)
setattr(acopy, "_"+attr, object_dict(list_copy))

return acopy

Expand Down
2 changes: 1 addition & 1 deletion cubes/metadata/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def aggregate(self, name):
there are multiple aggregates with the same name (which also means
that the model is not valid).
"""
name = str(name)
name = str(name)
try:
return self._aggregates[name]
except KeyError:
Expand Down
1 change: 1 addition & 0 deletions cubes/query/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def prepare_aggregates(self, aggregates=None, measures=None):
not self.is_builtin_function(agg.function) \
and agg.measure not in seen:
seen.add(agg.measure)


try:
aggregate = self.cube.aggregate(agg.measure)
Expand Down
2 changes: 1 addition & 1 deletion cubes/slicer/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def read_config(cfg):
help="Name of slicer.ini configuration file")
def sql(ctx, store, config):
"""SQL store commands"""
ctx.obj.workspace = cubes.Workspace(config)
ctx.obj.workspace = Workspace(read_config(config))
ctx.obj.store = ctx.obj.workspace.get_store(store)

################################################################################
Expand Down
9 changes: 8 additions & 1 deletion cubes/sql/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ def provide_members(self, cell, dimension, depth=None, hierarchy=None,
(statement, labels) = self.denormalized_statement(attributes, cell)
# Order and paginate
#
statement = statement.group_by(*statement.columns)

statement = statement.group_by(*[col._proxies[0] for col in statement.columns])
#statement = statement.group_by(*statement.columns)
statement = order_query(statement,
order,
labels=labels)
Expand Down Expand Up @@ -482,7 +484,9 @@ def denormalized_statement(self, attributes=None, cell=None,
attributes = attributes or self.cube.all_fact_attributes

refs = [attr.ref for attr in collect_attributes(attributes, cell)]

context_attributes = self.cube.get_attributes(refs)

context = self._create_context(context_attributes)

if include_fact_key:
Expand All @@ -491,11 +495,14 @@ def denormalized_statement(self, attributes=None, cell=None,
selection = []

names = [attr.ref for attr in attributes]

selection += context.get_columns(names)


cell_condition = context.condition_for_cell(cell)

statement = sql.expression.select(selection,
use_labels=True,
from_obj=context.star,
whereclause=cell_condition)

Expand Down
2 changes: 1 addition & 1 deletion cubes/sql/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def create_denormalized_view(self, cube, view_name=None, materialize=False,
# Note: this does not work with safe labels – since they are "safe"
# they can not conform to the cubes implicit naming schema dim.attr

(statement, _) = browser.denormalized_statement(attributes,
(statement, _) = browser.denormalized_statement([],#cube.get_attributes(),
include_fact_key=True)

schema = schema or self.naming.schema
Expand Down
2 changes: 1 addition & 1 deletion cubes/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def __init__(self, config=None, stores=None, load_base_model=True,
self.ns_languages = defaultdict(dict)
for section in config.sections():
if section.startswith("locale"):
lang = section[9:]
lang = section[7:]
# namespace -> path
for nsname, path in config.items(section):
if nsname == "defalt":
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setup(
name="cubes",
version='1.1',
version='1.1.1',

# Project uses reStructuredText, so ensure that the docutils get
# installed or upgraded on the target machine
Expand Down