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

Test passes if actual result contains duplicate rows but expected result doesn't #93

Open
1 of 5 tasks
prratek opened this issue Aug 25, 2023 · 0 comments
Open
1 of 5 tasks
Labels
bug Something isn't working

Comments

@prratek
Copy link

prratek commented Aug 25, 2023

Describe the bug

Because of the use of DISTINCT in set operations when comparing the expected and actual outputs, a test will pass even if one of the two contains duplicate rows. I was writing a test specifically to ensure that my model handles duplicates properly and this seemingly isn't possible to do.

Steps to reproduce

  1. Write a passing unit test
  2. Duplicate the last row of the expected output seed file, so that this should now have one row more than the actual model results
  3. Run the test again

Expected results

The test should fail because the outputs don't have the same row count. The expected output has one row more than the actual.

Actual results

The test passes

Screenshots and log output

N/A

System information

The contents of your packages.yml file:

packages:
  - package: dbt-labs/codegen
    version: 0.10.0
  - package: calogica/dbt_expectations
    version: 0.9.0
  - package: mjirv/dbt_datamocktool
    version: 0.3.2

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

❯ dbt --version
Core:
  - installed: 1.6.0
  - latest:    1.6.1 - Update available!

Additional context

My first thought was to switch the except distinct to an except all but apparently BigQuery does not support that?

Are you interested in contributing the fix?

@prratek prratek added the bug Something isn't working label Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant