marvin
marvin copied to clipboard
cube.getMaps requires explicit mode call to match original cube.mode
Describe the bug
Attempted to get a remote Maps from a remote Cube and it crashed looking it up my db. It works when I explicitly pass a mode
into getMaps
. It seems regardless of the Cube mode=remote
, the Maps call still uses mode=auto
. Is this the expected behaviour?
To Reproduce
- With DB on, in
master
branch - Get a remote cube
cube = Cube('8937-12705', mode='remote')
Cube hasmode='remote'
anddata-origin='api'
- Try to get a maps
maps = cube.getMaps()
. This fails as it tries to look up the cube in my local db. - This works.
maps=cube.getMaps(mode='remote')
Expected behavior
A Maps to be retrieved respecting the original cube.mode
. Should getXXX
methods use the mode of the original object automatically?
Additional context This may not be a bug. With my DB turned off, it behaves normally. This has vague recollections of an old Issue (that may have been resolved) but I couldn't find it.
This is the expected behaviour, but maybe not the desired one. I see advantages and disadvantages to this, but given that most people won't have a DB it makes some sense to me to keep the auto
mode to maximise the use of local resources. I'm going to add this to Marvin 3.0 so that we can make a decision then.