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

[CT-2822] [Bug] Measures on SemanticModels break on NonAdditiveDimension specification #8088

Closed
2 tasks done
QMalcolm opened this issue Jul 13, 2023 · 0 comments
Closed
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@QMalcolm
Copy link
Contributor

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

On Measures, one should be able to specify NonAdditiveDimension properties like so

semantic_models:
  ...
  measures:
    ...
    - name: total_account_balance_first_day
      agg: sum
      expr: order_cost
      non_additive_dimension:
        name: ds
        window_choice: min
        window_groupings:
          - user

However when you do so, an error gets raised

at path ['measures'][7]['non_additive_dimension']: {'name': 'ds', 'window_choice': 'min', 'window_groupings': ['user']} is not valid under any of the given schemas

Expected Behavior

An error should not be raised, the example YAML specification should not cause an error

Steps To Reproduce

  1. Define a Measure in your YAML with NonAdditiveDimension information
semantic_models:
  name: test_semantic_model
  model: ref('any_model_you_have')
  dimensions:
    - name: test_dimension
       type: categorical
       expr: true
  entities:
    - name: user
       type: primary
       expr: 1
  measures:
    - name: test_measure_with_not_additive_dimension
      agg: sum
      expr: 1
      non_additive_dimension:
        name: ds
        window_choice: min
        window_groupings:
          - user
  1. Run dbt parse

Relevant log output

at path ['measures'][7]['non_additive_dimension']: {'name': 'ds', 'window_choice': 'min', 'window_groupings': ['user']} is not valid under any of the given schemas

Environment

- OS: MacOS Ventura 13.4.1
- Python: 3.8.10
- dbt: HEAD

Which database adapter are you using with dbt?

snowflake

Additional Context

No response

@QMalcolm QMalcolm added the bug Something isn't working label Jul 13, 2023
@QMalcolm QMalcolm self-assigned this Jul 13, 2023
@github-actions github-actions bot changed the title [Bug] Measures on SemanticModels break on NonAdditiveDimension specification [CT-2822] [Bug] Measures on SemanticModels break on NonAdditiveDimension specification Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant