-
Notifications
You must be signed in to change notification settings - Fork 96
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
6 changed files
with
138 additions
and
4 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/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 00:00:00 | 5.00 | 1.00 | 0.00 | | ||
| 2019-12-18 00:00:00 | 4.00 | 4.00 | 2.00 | | ||
| 2019-12-19 00:00:00 | 4.00 | 6.00 | 6.00 | | ||
| 2019-12-19 00:00:00 | 5.00 | 2.00 | 0.00 | | ||
| 2019-12-20 00:00:00 | 5.00 | 2.00 | 0.00 | | ||
| 2020-01-01 00:00:00 | 4.00 | 2.00 | 1.00 | | ||
| 2020-01-02 00:00:00 | 4.00 | 3.00 | 3.00 | | ||
| 2020-01-02 00:00:00 | 5.00 | 1.00 | 0.00 | | ||
| 2020-01-03 00:00:00 | 5.00 | 1.00 | 0.00 | |
5 changes: 5 additions & 0 deletions
5
metricflow/test/snapshots/test_cli.py/str/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 00:00:00 | 5.00 | 1.00 | 0.00 | | ||
| 2019-12-18 00:00:00 | 4.00 | 4.00 | 2.00 | | ||
| 2019-12-19 00:00:00 | 4.00 | 6.00 | 6.00 | |
7 changes: 7 additions & 0 deletions
7
metricflow/test/snapshots/test_cli.py/str/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 00:00:00 | 5.00 | 1.00 | 0.00 | | ||
| 2019-12-19 00:00:00 | 5.00 | 2.00 | 0.00 | | ||
| 2019-12-20 00:00:00 | 5.00 | 2.00 | 0.00 | | ||
| 2020-01-02 00:00:00 | 5.00 | 1.00 | 0.00 | | ||
| 2020-01-03 00:00:00 | 5.00 | 1.00 | 0.00 | |