DataBrewery / cubes

[NOT MAINTAINED] Light-weight Python OLAP framework for multi-dimensional data analysis
http://cubes.databrewery.org
Other
1.49k stars 314 forks source link

AttributeError: 'module' object has no attribute 'validate_model' #457

Closed alexey74 closed 5 years ago

alexey74 commented 6 years ago

Looks like validate model is broken:


$ slicer model validate model.cubesmodel
Reading model model.cubesmodel
Validating model...
Traceback (most recent call last):
  File "/usr/local/bin/slicer", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/cubes/slicer/commands.py", line 587, in main
    cli(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/cubes/slicer/commands.py", line 166, in validate
    result = cubes.providers.validate_model(model)
AttributeError: 'module' object has no attribute 'validate_model'
christian-proust commented 6 years ago

I think this issue is done by the commit 7db2358fcc4ff7e0652b (Moved validation to metadata). For this reason, the function validate_model in module cube.providers does not exist anymore.

You can test a simple fix by editing the file cubes/slicer/commands.py line 24 and 166:

- from ..metadata import read_model_metadata, write_model_metadata_bundle
+ from ..metadata import read_model_metadata, write_model_metadata_bundle, validate_model

 

-      result = cubes.providers.validate_model(model)
+      result = validate_model(model)
jjmontesl commented 5 years ago

Closing this as @christian-proust fix has been merged to master.