These are chat archives for DataBrewery/cubes

3rd
Jun 2015
Friedrich Lindenberg
@pudo
Jun 03 2015 12:14
Friedrich Lindenberg
@pudo
Jun 03 2015 20:08
@Stiivi - what version of sqla is cubes 1.1 supposed to run with?
Stefan Urbanek
@Stiivi
Jun 03 2015 20:09
@pudo used to work with >= 0.9
Friedrich Lindenberg
@pudo
Jun 03 2015 20:10
oh no it's actually somethign else
Stefan Urbanek
@Stiivi
Jun 03 2015 20:12
what is the problem?
Friedrich Lindenberg
@pudo
Jun 03 2015 20:13
do I want to be on master or sqlrefactor?
Stefan Urbanek
@Stiivi
Jun 03 2015 20:13
sqlrefactor, don't use master
I'll merge probably this weekend and make current master a 1.0 branch
Friedrich Lindenberg
@pudo
Jun 03 2015 20:13
File "/Users/fl/Code/cubes/cubes/model.py", line 8, in <module>
from expressions import inspect_variables
ImportError: No module named expressions
Stefan Urbanek
@Stiivi
Jun 03 2015 20:14
ah!
new dependency: pip install epxressions
it is in the requirements.txt
Friedrich Lindenberg
@pudo
Jun 03 2015 20:15
grako, too
ok, I'm down to good errors :)
from cubes.extensions import extensions
that I can figure out
Stefan Urbanek
@Stiivi
Jun 03 2015 20:16
I wish grako generated stand-alone .py without dependency
Friedrich Lindenberg
@pudo
Jun 03 2015 20:17
out of interest: how unstable is 1.1 right now?
oh wow that expressions thing looks cool
Stefan Urbanek
@Stiivi
Jun 03 2015 20:21
maybe something between alpha stable and beta stable ... requires more testing
it is kind of feature complete, so testing is the last thing that is missing
Friedrich Lindenberg
@pudo
Jun 03 2015 20:22
ok. I'm going to digg into how I will supply the provider now
Stefan Urbanek
@Stiivi
Jun 03 2015 20:22
give me a sec
in your provider's package setup.py:
    entry_points={
        'cubes.providers': ['MyProvider = mypackage.mymodule:MyProviderClass'],
    },
it will load the module when you ask for the provider type
Friedrich Lindenberg
@pudo
Jun 03 2015 20:26
ooh nice.
Stefan Urbanek
@Stiivi
Jun 03 2015 20:27
I dropped the original custom extension mechanism and I'm using the setuptools native way
Friedrich Lindenberg
@pudo
Jun 03 2015 20:27
Stefan Urbanek
@Stiivi
Jun 03 2015 20:28
you can also register it manually:
from cubes import ext
ext.providers.register("my_provider", MyProviderClass)
no, provider is the same
you don't have to change the code, just how it is registered as a provider so cubes can find it
looking at your code – for 1.1, there are several changes:
create_MODELOBJECT(metadata) is now ModelObjectClass.from_dict(metadata) as in Dimension.from_dict(metadata)
/s/from_dict/from_metadata
Friedrich Lindenberg
@pudo
Jun 03 2015 20:31
easy enough :)
if I register the entrypoint in setup.py, how will cubes know to pick it?
through setuptools
Friedrich Lindenberg
@pudo
Jun 03 2015 20:33
no I mean are all available providers always queried?
no they are not
cubes will search for it the first time you request it
so if it is a module, it will be loaded only when you ask for it. if you use manual "cubes.ext.FOO.register()" in your code, then you have to have that module in your code
(note that the register() is not used in setup.py but in your code/app during initialization)
Friedrich Lindenberg
@pudo
Jun 03 2015 20:36
hm, do I still need to register it as a default store?
File "/Users/fl/Code/cubes/cubes/ext.py", line 199, in get
.format(self.type_, name))
InternalError: Unknown 'stores' extension 'spending'
Stefan Urbanek
@Stiivi
Jun 03 2015 20:36
same for stores, just s/providers/stores
Friedrich Lindenberg
@pudo
Jun 03 2015 20:37
also entrypoint?
Stefan Urbanek
@Stiivi
Jun 03 2015 20:37
setup.py:
    entry_points={
        'cubes.providers': [...],
        'cubes.stores': [...],
        'cubes.formatters': [...],
    },
Friedrich Lindenberg
@pudo
Jun 03 2015 20:37
awesome :)
this is a lot nicer now
great work
Stefan Urbanek
@Stiivi
Jun 03 2015 20:38
much simpler with the native interface
the format is "name=module.path:ClassName"
Friedrich Lindenberg
@pudo
Jun 03 2015 20:39
ok interesting
my tests are failing now because apparently cubes has no cubes
Stefan Urbanek
@Stiivi
Jun 03 2015 20:39
huh?
Friedrich Lindenberg
@pudo
Jun 03 2015 20:39
are you sure I don't need to enable the provider or store somehow?
Stefan Urbanek
@Stiivi
Jun 03 2015 20:40
are you trying bare slicer.ini?
Friedrich Lindenberg
@pudo
Jun 03 2015 20:40
I don't have a slicer.ini
Stefan Urbanek
@Stiivi
Jun 03 2015 20:40
try this:
import cubes

provider = cubes.ext.providers("spending", args...)
store = cubes.ext.stores("spending", args...)
let me know the errors
Friedrich Lindenberg
@pudo
Jun 03 2015 20:45
Ok, just gotta fix the constructors now
alright now I just need to hook the store and model provider into the workspace
Stefan Urbanek
@Stiivi
Jun 03 2015 20:51
workspace is one of the things that is unnecessarily more complex than it needs to be, I was just playing with few ideas how to simplify it for simpler situations such as this one - one model + one store
Friedrich Lindenberg
@pudo
Jun 03 2015 20:54
hm the store seems to register but what can I do with the provider?
app.cubes_workspace = Workspace()
from cubes import ext
ext.model_provider("spending", metadata={})
ext.store("spending")
app.cubes_workspace.register_default_store('spending')
is what I have now
Stefan Urbanek
@Stiivi
Jun 03 2015 20:55
you don't need those two ext.* lines
Friedrich Lindenberg
@pudo
Jun 03 2015 20:55
if I remove the ext. calls, the register thing won't work
Stefan Urbanek
@Stiivi
Jun 03 2015 20:55
ok, file that as an issue, because it should
Friedrich Lindenberg
@pudo
Jun 03 2015 20:56
will do
Stefan Urbanek
@Stiivi
Jun 03 2015 20:56
I'll look at it when I get home
as for the model: workspace.import_model(provider="spending")
Friedrich Lindenberg
@pudo
Jun 03 2015 20:59
that requires a model
Stefan Urbanek
@Stiivi
Jun 03 2015 21:03
try to pass {} as a model
another bug then
what timezone are you in?
Friedrich Lindenberg
@pudo
Jun 03 2015 21:06
CET
11pm here
Stefan Urbanek
@Stiivi
Jun 03 2015 21:07
ah, I'll be at my computer able to do changes in like 1.5h. if you gather all the issues you had with moving 1.0 -> 1.1 I'll look at them
Friedrich Lindenberg
@pudo
Jun 03 2015 21:08
thanks so much
Friedrich Lindenberg
@pudo
Jun 03 2015 21:46
It's aaaliiivvveee!
Stefan Urbanek
@Stiivi
Jun 03 2015 21:47
:+1: awesome! :smile:
I'm leaving office, will be online on the train shortly, fixing the bugs
Friedrich Lindenberg
@pudo
Jun 03 2015 21:48
cool I'm going to deploy and suffer catastrophic data loss
(that would also make for a good name for a band, btw)
Friedrich Lindenberg
@pudo
Jun 03 2015 22:24
damn, I was trying to deploy but heroku won't let me check out from the branch for some reason. will have to wait for the merge to master :)
Stefan Urbanek
@Stiivi
Jun 03 2015 22:36
Give me 1h
Friedrich Lindenberg
@pudo
Jun 03 2015 22:37
no no I'm just queueing notes here ;)
please don't let me push you
Stefan Urbanek
@Stiivi
Jun 03 2015 23:58
I’ve merged sqlrefactor with master, branched the original master as release-1.0.1