Coder Social home page Coder Social logo

cube_dbt's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cube_dbt's Issues

Package fails to inference type of column for PostgreSQL data_types

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

No module named 'math'

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

YAMLException: bad indentation of a sequence entry

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

  • CubeJS version: 0.34.5
  • cube_dbt version: 0.5.2

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() }}

Package import throws exception with python 3.8

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.