-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test cases for saved queries in the CLI.
- Loading branch information
Showing
9 changed files
with
179 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
metricflow/test/fixtures/semantic_manifest_yamls/simple_manifest/saved_queries.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
saved_query: | ||
name: p0_booking | ||
description: Booking-related metrics that are of the highest priority. | ||
metrics: | ||
- bookings | ||
- instant_bookings | ||
group_bys: | ||
- TimeDimension('metric_time', 'day') | ||
- Dimension('listing__capacity_latest') | ||
where: | ||
- "{{ Dimension('listing__capacity_latest') }} > 3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
metricflow/test/snapshots/test_cli.py/str/DuckDB/test_saved_query__cli_output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:-------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-01 | 5 | 1 | 0 | | ||
| 2019-12-18 | 4 | 4 | 2 | | ||
| 2019-12-19 | 4 | 6 | 6 | | ||
| 2019-12-19 | 5 | 2 | 0 | | ||
| 2019-12-20 | 5 | 2 | 0 | | ||
| 2020-01-01 | 4 | 2 | 1 | | ||
| 2020-01-02 | 4 | 3 | 3 | | ||
| 2020-01-02 | 5 | 1 | 0 | | ||
| 2020-01-03 | 5 | 1 | 0 | |
5 changes: 5 additions & 0 deletions
5
metricflow/test/snapshots/test_cli.py/str/DuckDB/test_saved_query_with_limit__cli_output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:-------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-01 | 5 | 1 | 0 | | ||
| 2019-12-18 | 4 | 4 | 2 | | ||
| 2019-12-19 | 4 | 6 | 6 | |
7 changes: 7 additions & 0 deletions
7
metricflow/test/snapshots/test_cli.py/str/DuckDB/test_saved_query_with_where__cli_output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:-------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-01 | 5 | 1 | 0 | | ||
| 2019-12-19 | 5 | 2 | 0 | | ||
| 2019-12-20 | 5 | 2 | 0 | | ||
| 2020-01-02 | 5 | 1 | 0 | | ||
| 2020-01-03 | 5 | 1 | 0 | |
11 changes: 11 additions & 0 deletions
11
metricflow/test/snapshots/test_cli.py/str/Postgres/test_saved_query__cli_output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-19 00:00:00 | 4 | 6 | 6 | | ||
| 2019-12-18 00:00:00 | 4 | 4 | 2 | | ||
| 2019-12-19 00:00:00 | 5 | 2 | 0 | | ||
| 2020-01-02 00:00:00 | 4 | 3 | 3 | | ||
| 2019-12-01 00:00:00 | 5 | 1 | 0 | | ||
| 2019-12-20 00:00:00 | 5 | 2 | 0 | | ||
| 2020-01-02 00:00:00 | 5 | 1 | 0 | | ||
| 2020-01-01 00:00:00 | 4 | 2 | 1 | | ||
| 2020-01-03 00:00:00 | 5 | 1 | 0 | |
5 changes: 5 additions & 0 deletions
5
...cflow/test/snapshots/test_cli.py/str/Postgres/test_saved_query_with_limit__cli_output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-19 00:00:00 | 4 | 6 | 6 | | ||
| 2019-12-18 00:00:00 | 4 | 4 | 2 | | ||
| 2019-12-19 00:00:00 | 5 | 2 | 0 | |
7 changes: 7 additions & 0 deletions
7
...cflow/test/snapshots/test_cli.py/str/Postgres/test_saved_query_with_where__cli_output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
| metric_time__day | listing__capacity_latest | bookings | instant_bookings | | ||
|:--------------------|---------------------------:|-----------:|-------------------:| | ||
| 2019-12-19 00:00:00 | 5 | 2 | 0 | | ||
| 2019-12-01 00:00:00 | 5 | 1 | 0 | | ||
| 2019-12-20 00:00:00 | 5 | 2 | 0 | | ||
| 2020-01-02 00:00:00 | 5 | 1 | 0 | | ||
| 2020-01-03 00:00:00 | 5 | 1 | 0 | |