cube-js / cube_dbt Goto Github PK
View Code? Open in Web Editor NEWdbt integration for Cube
dbt integration for Cube
DBT's data_type can have more broader set of types that are currently I see in package's source. The type can be any of supported in underlying database. For exple, PostgreSQL varchar type:
Error: invalid operation: Error while calling method: Python error: RuntimeError: Unknown column type of volumes.id: varchar(255)
Package version: 0.6.0
Hey folks, whenever I try to import cube_dbt
into my model/globals.py
module I get the error Error: Python error: ModuleNotFoundError: No module named 'math'
. However, if I start a Python interpreter the import works correctly and I am able to import the manifest as expected.
I am running Cube version 0.34.3 on an M1 Mac
When using the Jinja templating, we are experiencing an issue with the indentation. The description
and sql_table
values of the string are indented by an extra 4 spaces than is needed.
We have checked this by printing out the model and stripping out the additional spaces
model/globals.py
from cube import TemplateContext
from cube_dbt import Dbt
dbt = Dbt.from_file("./manifest.json")
template = TemplateContext()
@template.function("dbt_models")
def dbt_models():
return dbt.models
@template.function("dbt_model")
def dbt_model(name):
print(dbt.model.as_cube()).replace(' ',''))
return dbt.model(name)
model/cubes/deliveries.yml
{% set model = dbt_model('delivery_base') %}
cubes:
- {{ model.as_cube()) }}
dimensions:
{{ model.as_dimensions() }}
Hi,
Getting this error when trying to use package with python 3.8.16:
$ python3.8 dbt_to_cube.py Traceback (most recent call last):
File "dbt_to_cube.py", line 1, in <module>
from cube_dbt import Dbt
File "/home/user/.local/lib/python3.8/site-packages/cube_dbt/__init__.py", line 2, in <module>
from .dbt import Dbt
File "/home/user/.local/lib/python3.8/site-packages/cube_dbt/dbt.py", line 4, in <module>
from cube_dbt.model import Model
File "/home/user/.local/lib/python3.8/site-packages/cube_dbt/model.py", line 4, in <module>
class Model:
File "/home/user/.local/lib/python3.8/site-packages/cube_dbt/model.py", line 52, in Model
def columns(self) -> list[Column]:
TypeError: 'type' object is not subscriptable
Googling gave me following https://stackoverflow.com/a/75317316
Manually patching files:
cube_dbt/model.py
cube_dbt/dbt.py
fixes issue
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.