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

[Bug] --start-time / --end-time with cumulative windows broken #869

Closed
2 tasks done
ernestoongaro opened this issue Nov 14, 2023 · 2 comments · Fixed by #871
Closed
2 tasks done

[Bug] --start-time / --end-time with cumulative windows broken #869

ernestoongaro opened this issue Nov 14, 2023 · 2 comments · Fixed by #871
Assignees
Labels
bug Something isn't working High priority Created by Linear-GitHub Sync In Progress linear

Comments

@ernestoongaro
Copy link

Is this a new bug in metricflow?

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

Current Behavior

these two metrics:

 - name: cumulative_orders_one_week
    label: 1 week   
    type: cumulative
    type_params:
      measure: order_total
      window: 1 week

and

  - name: cumulative_orders_seven_days
    label: 7 days   
    type: cumulative
    type_params:
      measure: order_total
      window: 7 days

when we pass in --start-time and --end-time only the one with window 7 days is giving correct SQL generated

here's a diff of the two queries, the one on the left is filtering the time frame correctly, the one on the right is ignoring it
Pasted Graphic 1

Expected Behavior

Expect 1 week and 7 days windows to behave similarly

Steps To Reproduce

  1. in dbt jaffle sample add these two metrics to the bottom of orders.yml
  - name: cumulative_orders_one_week
    label: 1 week   
    type: cumulative
    type_params:
      measure: order_total
      window: 1 week
  - name: cumulative_orders_seven_days
    label: 7 days   
    type: cumulative
    type_params:
      measure: order_total
      window: 7 days

run

mf query --metrics cumulative_orders_one_week --group-by metric_time --start-time 2023-11-12 --end-time 2023-11-12 --explain

and

 mf query --metrics cumulative_orders_seven_days --group-by metric_time --start-time 2023-11-12 --end-time 2023-11-12 --explain

Relevant log output

No response

Environment

- OS: Mac
- Python: 3.9.6
- dbt: 1.7.1
- metricflow: 0.203.0

Which database are you using?

bigquery

Additional Context

Only tested on dbt-bigquery so far!

@ernestoongaro ernestoongaro added bug Something isn't working triage Tasks that need to be triaged labels Nov 14, 2023
@ernestoongaro
Copy link
Author

log in case it helps metricflow.log

@tlento tlento removed the triage Tasks that need to be triaged label Nov 14, 2023
@tlento tlento self-assigned this Nov 14, 2023
@tlento tlento added linear High priority Created by Linear-GitHub Sync In Progress labels Nov 14, 2023
@tlento
Copy link
Contributor

tlento commented Nov 15, 2023

Thanks for the detailed report @ernestoongaro ! I have attached the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working High priority Created by Linear-GitHub Sync In Progress linear
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants