DataBrewery / cubes

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

Tutorial errata #445

Closed cwallenpoole closed 5 years ago

cwallenpoole commented 7 years ago

In Python 3.6, new virtualenv

cleder commented 7 years ago

which version of cubes?

cwallenpoole commented 7 years ago

Master.

On Jul 24, 2017 6:02 AM, "Christian Ledermann" notifications@github.com wrote:

which version of cubes?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DataBrewery/cubes/issues/445#issuecomment-317376684, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJvdzNV4TzTRzDkeIeAgWKtDOloaQdOks5sRGvMgaJpZM4Ofxta .

SimonBaron commented 7 years ago

I found this too (python 2.7). From the documentation it seems that this should work but hasn't been implemented

Looking at the Workspace code this is the first line of __init__

        # Expect to get ConfigParser instance
        if config is not None and not isinstance(config, ConfigParser):
            raise ConfigurationError("config should be a ConfigParser instance,"
                                     " but is %r" % (type(config),))

I would suggest this should be altered to check also for a string type and create a ConfigParser object using the string - i'm just starting and I'm having a bit of trouble with the correct usage there, would it be


cp = ConfigParser()
cp.read(config)
config = cp
# or is it
config = ConfigParser().read(config)
silevad commented 6 years ago

This does not work as-is but bit of a nasty hack is adding an import to ConfigParser in application.py and then modify the last lines of application.py to the below :

    # Create a Slicer and register it at http://localhost:5000/slicer
    config = ConfigParser()
    config.read("slicer.ini")

    app.register_blueprint(slicer, url_prefix="/slicer", config=config)
    app.run(debug=True)

Disappointingly, even after this is started it does not appear to do anything as just get two buttons with no data so probably something more broken somewhere.

christian-proust commented 5 years ago

It is related to the same issue as #435: the ConfigParser should accept either a string or a config by using the function read_config.

jjmontesl commented 5 years ago

Closing as per @christian-proust comment and fix. Please reopen if the issue persists.