Commit 76aed0b
Made merge columns optional in sql query check (#945)
### PR summary:
1. Made sql_query support **merge_columns be optional/empty** and
documenting/demoing the two modes (row-level with merge_columns vs.
dataset-level). Added notebooks/docs/tests to prove the new behaviour,
including row-filters, metrics observers, ref DF support, negation, and
performance comparisons.
1. **Follow-up polish:** centralised the dataset-level logic into
_apply_dataset_level_sql_check, reused the new path in integration
tests, and tightened unit expectations so helpers (like DQDatasetRule)
stay type-stable.
1. **Hardening + helper cleanup**: reintroduced merge-column validation
to fail fast on bad inputs, forced dataset-level queries to error if
they emit more than one row, and added the shared
build_quality_violation helper so all integration expectations reuse the
same metadata factory. Also refreshed formatting/linting.
****TL;DR:** sql_query now covers both dataset-level and row-level
scenarios with clear validation and deterministic outputs, plus
comprehensive tests and docs to back it up.**
## Changes
<!-- Summary of your changes that are easy to understand. Add
screenshots when necessary -->
### Linked issues
<!-- DOC: Link issue with a keyword: close, closes, closed, fix, fixes,
fixed, resolve, resolves, resolved. See
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->
Resolves #938
### Tests
<!-- How is this tested? Please see the checklist below and also
describe any other relevant tests -->
- [x] manually tested
- [x] added unit tests
- [x] added integration tests
- [ ] added end-to-end tests
- [ ] added performance tests
---------
Co-authored-by: Greg Hansen <[email protected]>
Co-authored-by: Marcin Wojtyczka <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: mwojtyczka <[email protected]>1 parent 7c2253b commit 76aed0b
File tree
9 files changed
+966
-172
lines changed- demos
- docs/dqx/docs/reference
- src/databricks/labs/dqx
- tests
- integration
- perf/.benchmarks
- resources
- unit
9 files changed
+966
-172
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
943 | 943 | | |
944 | 944 | | |
945 | 945 | | |
946 | | - | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
947 | 951 | | |
948 | 952 | | |
949 | 953 | | |
950 | | - | |
| 954 | + | |
951 | 955 | | |
952 | 956 | | |
953 | 957 | | |
| |||
973 | 977 | | |
974 | 978 | | |
975 | 979 | | |
976 | | - | |
| 980 | + | |
977 | 981 | | |
978 | 982 | | |
979 | 983 | | |
| |||
990 | 994 | | |
991 | 995 | | |
992 | 996 | | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
993 | 1032 | | |
994 | 1033 | | |
995 | 1034 | | |
| |||
1028 | 1067 | | |
1029 | 1068 | | |
1030 | 1069 | | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1031 | 1094 | | |
1032 | 1095 | | |
1033 | 1096 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
0 commit comments