-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add order_by
and limit
fields to saved queries
#10532
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10532 +/- ##
==========================================
+ Coverage 89.18% 89.20% +0.01%
==========================================
Files 183 183
Lines 23434 23438 +4
==========================================
+ Hits 20899 20907 +8
+ Misses 2535 2531 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
aa60b04
to
a163ffa
Compare
5df9fc4
to
a0db17d
Compare
@QMalcolm I'm getting a CI check failure wrt schemas so I must be missing something. Do you know what's up? |
@plypaul You'll need to update the schema docs in a different repo. The CI check won't pass until those match what's here. Kind of a race condition though. The CI failure seems more like a reminder to make sure you update the other repo. Instructions here: https://www.notion.so/dbtlabs/Bump-Schema-Version-dd308bab6a044c7d8cb6935691732ab3?pvs=4#7422ed5c56484401b74ce508916135d9 |
@plypaul also, I added a few targets in the |
@@ -16,6 +16,10 @@ | |||
- "{{ Dimension('user__ds', 'DAY') }} <= now()" | |||
- "{{ Dimension('user__ds', 'DAY') }} >= '2023-01-01'" | |||
- "{{ Metric('txn_revenue', ['id']) }} > 1" | |||
order_by: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend adding some logic in tests/functional/saved_queries/test_saved_query_parsing.py
to test that these values parse as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added.
@@ -19098,6 +19098,23 @@ | |||
"type": "null" | |||
} | |||
] | |||
}, | |||
"order_by": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if you saw this / used it but there is a make json_schema
target you can use to generate this.
Aside from the comments I left, this looks good to me from what context I have! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Paul! 🚢
ace0b32
to
485b70f
Compare
Originally this work was done as part of #49. However as they are additive fields that have a default values, they aren't breaking changes. Thus here we're adding them to the v12 manifest. This is in support of the currently open dbt-core PR dbt-labs/dbt-core#10532. Note this also _drops_ the `vars` field from a few objects. It was originally added to support changes in core (dbt-labs/dbt-core#10793). However, those changes were reverted in core (dbt-labs/dbt-core#10813). Since `vars` as a field never went out in a GA release of dbt-core, it is safe for us to drop it.
Originally this work was done as part of #49. However as they are additive fields that have a default values, they aren't breaking changes. Thus here we're adding them to the v12 manifest. This is in support of the currently open dbt-core PR dbt-labs/dbt-core#10532. Note this also _drops_ the `vars` field from a few objects. It was originally added to support changes in core (dbt-labs/dbt-core#10793). However, those changes were reverted in core (dbt-labs/dbt-core#10813). Since `vars` as a field never went out in a GA release of dbt-core, it is safe for us to drop it.
fce2cb4
to
d9160e8
Compare
d9160e8
to
05f5983
Compare
Originally this work was done as part of #49. However as they are additive fields that have a default values, they aren't breaking changes. Thus here we're adding them to the v12 manifest. This is in support of the currently open dbt-core PR dbt-labs/dbt-core#10532. Note this also _drops_ the `vars` field from a few objects. It was originally added to support changes in core (dbt-labs/dbt-core#10793). However, those changes were reverted in core (dbt-labs/dbt-core#10813). Since `vars` as a field never went out in a GA release of dbt-core, it is safe for us to drop it.
b5ba524
to
189867c
Compare
189867c
to
253ea6d
Compare
Resolves #10531
Problem
Saved queries do not allow specification of a limit to the number of rows returns or items to order the results.
Related: dbt-labs/metricflow#1113
Solution
Add
order_by
andlimit
fields to the saved query definition.Checklist