Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use keyword argument in Jinja for as_dimensions() #8

Open
bzenker-amplify opened this issue Jun 12, 2024 · 0 comments
Open

Comments

@bzenker-amplify
Copy link

bzenker-amplify commented Jun 12, 2024

I am unable to use a python keyword argument (aka named parameter) within a cube_dbt Jinja template.

This argument is noted here, and in the cube documentation, as being able to be defined with a keyword argument:
https://github.com/cube-js/cube_dbt/blob/main/src/cube_dbt/model.py#L90

I'll use the following example to explain

{% set model = dbt_model('my_table') %}
cubes:
  - {{ model.as_cube() }}
    dimensions:
      {{ model.as_dimensions(skip=['my_bad_time_column']) }}

Expected Behavior

The runtime compilation would skip ingestion of my_table.my_bad_time_column

Current Behavior

Cube fails to runtime compile its semantic layer, because it attempts to include that column.

RuntimeError: Unknown column type of my_table.my_bad_time_column: timestamp_ntz

Current Workaround

Pass the parameter as a positional argument. This works for me:

{% set model = dbt_model('my_table') %}
cubes:
  - {{ model.as_cube() }}
    dimensions:
      {{ model.as_dimensions(['my_bad_time_column']) }}

Context (Environment)

Running the Docker Image cubejs/cube:v0.35.47
with notable environment variables of

CUBEJS_DEV_MODE=true
CUBEJS_DB_TYPE="snowflake"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant