Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Redshift] Add tests for unit testing #680

Merged
merged 10 commits into from
Feb 9, 2024
Merged

Conversation

MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Dec 4, 2023

addresses: dbt-labs/dbt-core#9467
docs dbt-labs/docs.getdbt.com/#

Problem

Currently, the unit testing framework in core uses the safe_cast utils macro to convert a user-provided value for an input mock to the appropriate type. In some instances, this safe_cast may fail and need special handling depending on the type.

The acceptance criteria for this issue is to introduce a test that provides coverage across all primative input types (and arrays & objects if possible!) for unit testing input data, potentially updating the safe_cast macro as necessary.

Solution

  • tests for primative types + json.
  • arrays don't work out of the box and will be addressed in follow-up work.
  • skipping changelog as this change just adds tests

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@cla-bot cla-bot bot added the cla:yes label Dec 4, 2023
Copy link
Contributor

github-actions bot commented Dec 4, 2023

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-redshift contributing guide.

@MichelleArk MichelleArk force-pushed the adapter-unit-test-types branch from 1e2cf13 to 63c650c Compare December 4, 2023 08:06
@MichelleArk MichelleArk changed the title first pass: unit testing type tests [Redshift] test types for unit testing Feb 6, 2024
@MichelleArk MichelleArk changed the title [Redshift] test types for unit testing [Redshift] Add tests for unit testing Feb 6, 2024
@MichelleArk MichelleArk added the Skip Changelog Skips GHA to check for changelog file label Feb 6, 2024
@MichelleArk MichelleArk marked this pull request as ready for review February 7, 2024 14:17
@MichelleArk MichelleArk requested a review from a team as a code owner February 7, 2024 14:17
setup.py Outdated Show resolved Hide resolved
dev-requirements.txt Outdated Show resolved Hide resolved
@mikealfare mikealfare merged commit 6906eb0 into main Feb 9, 2024
15 checks passed
@mikealfare mikealfare deleted the adapter-unit-test-types branch February 9, 2024 15:23
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
cla:yes Skip Changelog Skips GHA to check for changelog file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants