Representation of dimensions and cubes as a file

31 views
Skip to first unread message

Steffen Hartmann

unread,
Jun 9, 2016, 1:30:33 PM6/9/16
to Cubes
Hey guys,

I got a lot of dimensions and cubes and I would like to create a file for each of them.
I followed the instruction here, but I do get an exception while starting the slicer server:

2016-06-09 19:24:36,849 DEBUG Importing model from cube_complaint.json. Provider: None Store: None NS: None
Traceback (most recent call last):
  File "C:\Python34\Scripts\slicer-script.py", line 9, in <module>
    load_entry_point('cubes==1.0.1', 'console_scripts', 'slicer')()
  File "C:\Python34\lib\site-packages\cubes\slicer\commands.py", line 516, in main
    args.func(args)
  File "C:\Python34\lib\site-packages\cubes\slicer\commands.py", line 195, in run_server
    cubes.server.run_server(config, debug=args.debug)
  File "C:\Python34\lib\site-packages\cubes\server\base.py", line 56, in run_server
    app = create_server(config)
  File "C:\Python34\lib\site-packages\cubes\server\base.py", line 47, in create_server
    app.register_blueprint(slicer, config=config, **_options)
  File "C:\Python34\lib\site-packages\flask\app.py", line 62, in wrapper_func
    return f(self, *args, **kwargs)
  File "C:\Python34\lib\site-packages\flask\app.py", line 889, in register_blueprint
    blueprint.register(self, options, first_registration)
  File "C:\Python34\lib\site-packages\flask\blueprints.py", line 153, in register
    deferred(state)
  File "C:\Python34\lib\site-packages\flask\blueprints.py", line 128, in wrapper
    func(state)
  File "C:\Python34\lib\site-packages\cubes\server\blueprint.py", line 101, in initialize_slicer
    current_app.cubes_workspace = Workspace(config, **_options)
  File "C:\Python34\lib\site-packages\cubes\workspace.py", line 328, in __init__
    self.import_model(path)
  File "C:\Python34\lib\site-packages\cubes\workspace.py", line 492, in import_model
    provider = extensions.model_provider(provider_name, model)
  File "C:\Python34\lib\site-packages\cubes\extensions.py", line 113, in __call__
    return self.create(_extension_name, *args, **kwargs)
  File "C:\Python34\lib\site-packages\cubes\extensions.py", line 126, in create
    return extension(*args, **kwargs)
  File "C:\Python34\lib\site-packages\cubes\providers.py", line 314, in __init__
    super(StaticModelProvider, self).__init__(*args, **kwargs)
  File "C:\Python34\lib\site-packages\cubes\providers.py", line 59, in __init__
    self.dimensions_metadata[dim["name"]] = dim
TypeError: string indices must be integers

Here is my setup:

slicer.ini:
[models]
model: model.json
cube_complaint: cube_complaint.json
dim_issue: dim_issue.json

model.json:
{
"name": "Complaint Model",
"label": "Complaint Model",
"cubes": [
{"name": "cube_complaint"}
],
"dimensions": [
{"name": "dim_issue"}
]
}

dim_issue:
{
"name": "dim_issue",
"label": "Issue",
"attributes": [
{"name": "IssueID", "label": "Issue Number"},
{"name": "IssueName", "label": "Issue Name"}
]
}

cube_complaint:
{
"name": "cube_complaint",
"label": "Complaints",
"dimensions": [ "dim_issue" ]
}


If I merge the dimension and the cube by hand, everything works well for me.
Furthermore I do net get the exception when I remove the dimension list inside the cube.

Are there any more detailed information about file representation?

Thanks alot!

Reply all
Reply to author
Forward
0 new messages