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

Last tutorial example needs 'transaction__' prefix for 'is_large' dimension #1549

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nathanjones4323
Copy link

@nathanjones4323 nathanjones4323 commented Nov 25, 2024

Summary of change

This PR corrects the final tutorial example query to include the required transaction__ prefix for the is_large dimension. Without this prefix, the query produces an error, which could confuse users. The updated example ensures the query works as intended.

Output before change

>>> mf query --metrics transactions,transaction_usd_na --group-by metric_time,is_large --order metric_time --start-time 2022-03-20 --end-time 2022-04-01

⠹ Initiating query…
ERROR: Got errors while resolving the query.

Error #1:
Message:

The given input does not match any of the available group-by-items for
Measure('transactions'). Common issues are:

  * Incorrect names.
  * No valid join paths exist from the measure to the group-by-item.
    (fan-out join support is pending).
  * There are multiple matching join paths.
    (disambiguation support is pending).

Suggestions:
  [
    'transaction__is_large',
    'id_order',
    'transaction__ds__day',
    'transaction__id_order',
    'customer',
    'metric_time__day',
  ]

Query Input:

is_large

Issue Location:

[Resolve Query(['transactions', 'transaction_usd_na'])]
  -> [Resolve Metric('transactions')]
    -> [Resolve Measure('transactions')]

Error #1:
Message:

The given input does not match any of the available group-by-items for
Measure('transaction_amount_usd'). Common issues are:

  * Incorrect names.
  * No valid join paths exist from the measure to the group-by-item.
    (fan-out join support is pending).
  * There are multiple matching join paths.
    (disambiguation support is pending).

Suggestions:
  [
    'transaction__is_large',
    'id_order',
    'transaction__ds__day',
    'transaction__id_order',
    'customer',
    'metric_time__day',
  ]

Query Input:

is_large

Issue Location:

[Resolve Query(['transactions', 'transaction_usd_na'])]
  -> [Resolve Metric('transaction_usd_na')]
    -> [Resolve Measure('transaction_amount_usd')]

Log file: /Users/nathanjones/dbt/logs/metricflow.log

Output after change

mf query --metrics transactions,transaction_usd_na --group-by metric_time,transaction__is_large --order metric_time --start-time 2022-03-20 --end-time 2022-04-01

✔ Success 🦄 - query completed after 0.40 seconds
metric_time__day transaction__is_large transactions transaction_usd_na


2022-03-21T00:00:00 True 3 639.87
2022-03-22T00:00:00 True 3 522.68
2022-03-23T00:00:00 True 2 215.14
2022-03-25T00:00:00 True 3 66.60
2022-03-26T00:00:00 True 2 179.91
2022-03-27T00:00:00 True 2 316.98
2022-03-28T00:00:00 True 1 266.90
2022-03-29T00:00:00 True 2 None
2022-03-30T00:00:00 True 4 534.25
2022-03-31T00:00:00 True 5 1170.96
2022-04-01T00:00:00 True 1 100.40

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

Successfully merging this pull request may close these issues.

1 participant