Use dbt test queries in place of pytest - #20
Open
log-head wants to merge 1 commit into
Open
Conversation
combscCode
approved these changes
Apr 6, 2025
combscCode
left a comment
Collaborator
There was a problem hiding this comment.
approving, a couple of comments to address in here but I trust you to address those then merge the code in! Thanks for this!
Feel free to ping me again on this if you want me to double check your changes if you're unsure.
Comment on lines
+22
to
+43
| /* | ||
| WITH expected_results AS ( | ||
| SELECT TIMESTAMP '2023-11-22 02:00:00' AS begin, | ||
| TIMESTAMP '2023-11-22 04:00:00' AS stop, | ||
| 'a' AS cce_id | ||
| UNION ALL | ||
| SELECT TIMESTAMP '2023-11-22 04:30:00', | ||
| CAST(NULL AS TIMESTAMP), | ||
| 'a' | ||
| UNION ALL | ||
| SELECT TIMESTAMP '2023-11-22 02:00:00', | ||
| TIMESTAMP '2023-11-22 04:00:00', | ||
| 'b' | ||
| ) | ||
| SELECT actual.* | ||
| FROM public.freeze_fridge_alarms actual | ||
| LEFT JOIN expected_results expected | ||
| ON actual.begin = expected.begin | ||
| AND actual.stop IS NOT DISTINCT FROM expected.stop | ||
| AND actual.cce_id = expected.cce_id | ||
| WHERE expected.begin IS NULL | ||
| */ No newline at end of file |
Collaborator
There was a problem hiding this comment.
hmm is this a window into your development process? ;)
Please remove this!
| ./load/load_csvs.sh | ||
| dbt build | ||
| pytest tests | ||
| dbt test |
Collaborator
There was a problem hiding this comment.
awesome!!! Could you also remove pytest dependencies in the Dockerfile + requirements.txt?
Comment on lines
+1
to
+3
| SELECT * | ||
| FROM {{ ref('heat_fridge_alarms') }} | ||
| LIMIT 1 No newline at end of file |
Collaborator
There was a problem hiding this comment.
question for my understanding: Is this test basically asserting that heat fridge alarms aren't created for our test data?
Collaborator
|
oh also make sure to pass the linter. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moving the existing pytest tests to queries for using with dbt test.