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

Make compare query columns multi pk #105

Merged

Conversation

joellabes
Copy link
Contributor

Description & motivation

Checklist

  • I have verified that these changes work locally
  • I have updated the README.md (if applicable)
  • I have added tests & descriptions to my models (and macros if applicable)

@joellabes joellabes changed the base branch from main to joellabes-audit-helper-revamp June 7, 2024 04:58
@joellabes joellabes merged commit dee003b into joellabes-audit-helper-revamp Jun 13, 2024
5 checks passed
joellabes added a commit that referenced this pull request Jun 13, 2024
* Add new macros for diff calculation, and unit tests (#99)

* Add macro for new hash-based comparison strategy

* split out SF-focused version of macro

* Fix change to complex object

* Fix overuse of star

* switch from compare rels to compare queries

* provide wrapping parens

* switch to array of columns for PK

* split unit tests into own files, change unit tests to array pk

* tidy up get_comp_bounds

* fix arg rename

* add quick_are_queries_identical and unit tests

* Move data tests into own directory

* Add test for multiple PKs

* fix incorrect unit test configs

* make data types for id and id_2 big enough nums

* Mock event_time response

* fix hardcoded value in quick_are_qs_identical

* Add unit tests for null handling (still broken)

* Rename columsn to be more unique

* Steal surrogate key macro from utils

* Use generated surrogate key across the board in place of PK

* rm my profile reference

* Update quick_are_queries_identical.sql

* Add diagram explaining comparison bounds

* Add comments explaining warehouse-specific optimisations

* cross-db support

* subq

* no postgres or redshift for a sec

* add default var values for compare wrappers

* avoid lateral alias reference for BQ

* BQ doesn't support count(arg1, arg2)

* re-enable redshift

* Alias subq for redshift

* remove extra comma

* add row status of nonunique_pk

* remove redundant test and wrapper model

* Create json-y tests for snowflake

* Add workaround for redshift to support count num rows in status

* skip incompatible tests

* Fix redshift lack of bool_or support in window funcs

* add skip exclusions for everything else

* fix incorrect skip tag application

* Move user configs to project.yml from profiles

* Temporarily disable unpassable redshift tests

* add temp skip to circle's config.yml

* forgot tag: method

* Temporarily skip reworked_compare_all_statuses_different_column_set

* Skip another test redshift

* disable unsupported tests BQ

* postgres too?

* Fixes for postgres

* namespace macros

* It's a postgres problem, not a redshift problem

* Handle postgres 63 char limit

* Add databricks

* Rename tests to data_tests

* Found a better workaround for missing count distinct window

* actually call the macro

* disable syntax-failing tests on dbx

* try to install core from main to get sorting fix

* Revert "try to install core from main to get sorting fix"

This reverts commit d28f3e1.

* Audit helper code review changes

* add BQ support for qucik are queries identical

* explain why using dense_rank

* remove the compile step to avoid compilation error

* Don't throw incompatible quick compare error during parse

* add where clause to check we're not assuming its absence

* enable first basic struct tests

* Skip raising exception during parsing

* json_build_object doesn't work on rs

* changed behaviour redshift

* skip complex structs on rs for now

* temp disable all complex structs

* skip some currently failoing bq tests

* Properly exclude tests to skip, add comments

* dbx too

* rename reworked_compare to compare_and_classify_query_results

* Rename files

* rename macro file

* Add relation_focused macros

* Add BQ-specific generate_set_results for hashes, enable json tests

* Implement hash comparisons for BQ and DBX (#103)

* disable tests for unrelated adapters

* Avoid lateral column aliasing

* First cross-db complex struct fixture

* Add final fixtures

* Initial work on dbx compatibility

* remove lateral column alias dbx

* cast everything as string before hashing

* add comment, enable all tests again

* rename to dbt_audit_in_a instead of in_a

* Protect against missing PK columns

* gitignore package-lock.yml

* add dbx variant of simple structs

* Rename private macros to have _ prefix

* Fix get comparison bounds (#104)

* change to getting comparison bounds for queries not relations

* add test for introspective queries

* Make compare query columns multi pk (#105)

* rm packagelock.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant