Describe the bug
I would like to move some code out of the cube.py file as it becomes very large and hard to maintain. But I fail to make it work in the cube docker container to import the outsourced files. also, unit testing my functions becomes impossible, because if i try to import the functions from cube.py the imports fail (there is no possibility to import this line: from cube import config).
def test_function(query: dict) -> dict:
# do something
return query
Dockerfile
FROM cubejs/cube:v0.35.57
COPY cube.py /cube/conf/
COPY cube_utils.py /cube/conf/
build the docker file:
docker build -f test.Dockerfile -t cube .
run the docker container:
docker run -it cube
Cube Error ---------------------------------------
Error: Python error: ModuleNotFoundError: No module named 'cube_utils'
Traceback (most recent call last):
File "cube.py", line 2, in <module>
from cube_utils import test_function
Expected behavior
Cube API should start without a problem with the above setup.
Describe the bug I would like to move some code out of the cube.py file as it becomes very large and hard to maintain. But I fail to make it work in the cube docker container to import the outsourced files. also, unit testing my functions becomes impossible, because if i try to import the functions from
cube.py
the imports fail (there is no possibility to import this line:from cube import config
).To Reproduce
cube.py
cube_utils.py
Dockerfile
docker build -f test.Dockerfile -t cube .
Expected behavior Cube API should start without a problem with the above setup.
Screenshots n/a, see above
Minimally reproducible Cube Schema
not needed, see above.
Version: v0.35.57