diff --git a/cubes/model.py b/cubes/model.py index ddb2c37b..2ed40df1 100644 --- a/cubes/model.py +++ b/cubes/model.py @@ -694,7 +694,7 @@ def distilled_hierarchies(self): hierarchies[key] = levels if dim.default_hierarchy_name == hier.name: - hierarchies[(dim.name, None)] = levels + hierarchies[(dim.name, "default")] = levels return hierarchies @@ -773,7 +773,7 @@ def validate(self): results = [] # Check whether all attributes, measures and keys are Attribute objects - # This is internal consistency chceck + # This is internal consistency check measures = set() @@ -1090,13 +1090,13 @@ def __init__(self, name, levels=None, hierarchies=None, elif nonadditive in ["all", "any"]: self.nonadditive = "all" elif nonadditive != "time": - raise ModelError("Unknown non-additive diension type '%s'" + raise ModelError("Unknown non-additive dimension type '%s'" % nonadditive) self.nonadditive = nonadditive if not levels and not attributes: - raise ModelError("No levels or attriutes specified for dimension %s" % name) + raise ModelError("No levels or attributes specified for dimension %s" % name) elif levels and attributes: raise ModelError("Both levels and attributes specified") @@ -1354,7 +1354,7 @@ def clone(self, hierarchies=None, exclude_hierarchies=None, else: default_hierarchy_name = hierarchies[0].name - # TODO: should we do deppcopy on info? + # TODO: should we do deepcopy on info? name = alias or self.name return Dimension(name=name, @@ -1438,7 +1438,7 @@ def validate(self): if len(self._hierarchies) > 1 and \ not "default" in self._hierarchies: results.append(('error', - "No defaut hierarchy specified, there is " + "No default hierarchy specified, there is " "more than one hierarchy in dimension " "'%s'" % self.name)) @@ -1882,7 +1882,7 @@ def __init__(self, name, attributes, key=None, order_attribute=None, elif nonadditive in ["all", "any"]: self.nonadditive = "all" elif nonadditive != "time": - raise ModelError("Unknown non-additive diension type '%s'" + raise ModelError("Unknown non-additive dimension type '%s'" % nonadditive) self.nonadditive = nonadditive @@ -2158,7 +2158,7 @@ def localized_ref(self, locale): """ if locale: if not self.locales: - raise ArgumentError("Attribute '{}' is not loalizable " + raise ArgumentError("Attribute '{}' is not localizable " "(localization {} requested)" .format(self.name, locale)) elif locale not in self.locales: @@ -2175,7 +2175,7 @@ def localized_ref(self, locale): @property def dependencies(self): """Set of attributes that the `attribute` depends on. If the - `attribute` is an expresion, then returns the direct dependencies from + `attribute` is an expression, then returns the direct dependencies from the expression. If the attribute is an aggregate with an unary function operating on a measure, then the measure is considered as a dependency. Attribute can't have both expression and measure @@ -2301,7 +2301,7 @@ def __init__(self, name, label=None, description=None, order=None, other measure that refers to this one (no circular reference). The `aggregates` is an optional property and is used for: - * measure aggergate object preparation + * measure aggregate object preparation * optional validation String representation of a `Measure` returns its full reference. @@ -2400,12 +2400,12 @@ def __init__(self, name, label=None, description=None, order=None, info=None, format=None, missing_value=None, measure=None, function=None, formula=None, expression=None, nonadditive=None, window_size=None, **kwargs): - """Masure aggregate + """Measure aggregate Attributes: * `function` – aggregation function for the measure - * `formula` – name of a formula that contains the arithemtic + * `formula` – name of a formula that contains the arithmetic expression (optional) * `measure` – measure name for this aggregate (optional) * `expression` – arithmetic expression (only if backend supported) diff --git a/cubes/sql/query.py b/cubes/sql/query.py index 27c6cda6..641dfd9c 100644 --- a/cubes/sql/query.py +++ b/cubes/sql/query.py @@ -957,7 +957,7 @@ def conditions_for_cuts(self, cuts): conditions = [] for cut in cuts: - hierarchy = str(cut.hierarchy) if cut.hierarchy else None + hierarchy = str(cut.hierarchy) if cut.hierarchy else "default" if isinstance(cut, PointCut): path = cut.path diff --git a/cubes/workspace.py b/cubes/workspace.py index b1dd5de2..bb31f856 100644 --- a/cubes/workspace.py +++ b/cubes/workspace.py @@ -494,7 +494,7 @@ def cube_names(self, identity=None): """Return names all available cubes.""" return [cube["name"] for cube in self.list_cubes()] - # TODO: this is not loclized!!! + # TODO: this is not localized!!! def list_cubes(self, identity=None): """Get a list of metadata for cubes in the workspace. Result is a list of dictionaries with keys: `name`, `label`, `category`, `info`. @@ -550,7 +550,7 @@ def cube(self, ref, identity=None, locale=None): lookup = namespace.translation_lookup(locale) if lookup: - # TODO: pass lookup instead of jsut first found translation + # TODO: pass lookup instead of just first found translation context = LocalizationContext(lookup[0]) trans = context.object_localization("cubes", cube.name) cube = cube.localized(trans) @@ -622,7 +622,7 @@ def browser(self, cube, locale=None, identity=None): options.update(cube_options) # TODO: Construct options for the browser from cube's options - # dictionary and workspece default configuration + # dictionary and workspace default configuration browser_name = cube.browser if not browser_name and hasattr(store, "default_browser_name"): diff --git a/doc/model.rst b/doc/model.rst index d67a7744..2a4e1707 100644 --- a/doc/model.rst +++ b/doc/model.rst @@ -118,7 +118,7 @@ Mappings and Joins One can specify shared mappings and joins on the model-level. Those mappings and joins are inherited by all the cubes in the model. -The ``mappigns`` dictionary of a cube is merged with model's global mapping +The ``mappings`` dictionary of a cube is merged with model's global mapping dictionary. Cube's values overwrite the model's values. The ``joins`` can be considered as named templates. They should contain diff --git a/doc/schemas.rst b/doc/schemas.rst index de61236b..9c75f414 100644 --- a/doc/schemas.rst +++ b/doc/schemas.rst @@ -58,7 +58,7 @@ Simple Dimension neither hierarchy.* Similar schema as `Simple Star Schema`_ Note the dimension `year` which is -represented just by one numeroc attribute. +represented just by one numeric attribute. It is important that no attributes are specified for the dimension. There dimension will be referenced just by its name and dimension label is going to @@ -142,7 +142,7 @@ it in the `schema` argument of :meth:`cubes.Workspace.register_store`: url=DATABASE_URL, schema="sales_datamart") -For the :doc:`server` the schema is specifiedn in the ``[store]`` section +For the :doc:`server` the schema is specified in the ``[store]`` section of the `slicer.ini` configuration file: .. code-block:: ini @@ -520,7 +520,7 @@ attribute) with the `label` attribute: Key and Label Attribute ----------------------- -*Synopsis: specify which attributes are going to be used for flitering (keys) +*Synopsis: specify which attributes are going to be used for filtering (keys) and which are going to be displayed in the user interface (labels)* .. image:: images/schemas/schema-label_attributes.png diff --git a/tests/test_localization.py b/tests/test_localization.py index a92f9e1d..59e880c3 100644 --- a/tests/test_localization.py +++ b/tests/test_localization.py @@ -54,6 +54,6 @@ def test_translate_cube(self): self.assertEqual(cube.label, "inner_LAB") # TODO: test non existent top object - # TODO: test non existend child object + # TODO: test non existent child object # TODO: test plain label