-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Unit Testing] Allow explicit precision testing in unit tests #9884
Comments
@graciegoheen Can you take a look at spike outcome here and see whether you think this ticket is worth pursuing? |
We should document it do not work if we are not moving forward on this ticket. |
I think:
is the best place to put this configuration The configuration is:
I'll sync with unit testing squad on what interface would be best here |
What would be the consequences if we cast the expected output to the widest scale/precision/character size for the relevant data type? i.e., It might give a failing unit test the way that we are after. My understanding is that we use "wide" data types by default when enforcing model contracts. I'm not sure if there's prior art we could re-use here.
|
We ran into this in and had a related discussion on the dbt slack here
For Redshift at least casting to just Numeric results in (18,0) An option to use the types defined in our contract for the model would have been a nice way to solve this from our perspective. Being not too familiar with the implementation I thought the contract was the source of the truth for the expected data types. But that may not be possible if the contract uses "wide" data types |
Housekeeping
Short description
We cannot currently unit test precision. The expected outputs get rounded to be the expected datatypes and therefore are not correctly parsed.
from @MichelleArk in #9627
Acceptance criteria
Suggested Tests
model.sql
failing unit test yaml
passing unit test yaml
Impact to Other Teams
none
Will backports be required?
no
Context
Outcome of spike in #9627
This will required a change to the macros in
dbt-adapters
and tests indbt-core
. The tests indbt-core
will not pass until a new version ofdbt-adapters
is released.The text was updated successfully, but these errors were encountered: