8000 comparing across same datatype, different length by rhaffar · Pull Request #411 · capitalone/datacompy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

comparing across same datatype, different length #411

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

Merged
merged 3 commits into from
May 12, 2025

Conversation

rhaffar
Copy link
Contributor
@rhaffar rhaffar commented May 12, 2025

Snowflake/Snowpark datatypes can vary by length - additionally, string representation of those types bakes in these variances. Updating comparisons to compare directly on types to allow for comparing same types with different lengths/precisions.

The datatype returned by field.datatype is actually an instance of a datatype class which bakes in length/precision, which is why we compare on the type of the datatype field. We use the datatype field to call the simple_string instance method to get a string representation of the datatype, and the type of the datatype field for actual comparison.

All Snowflake tests passing.

@rhaffar rhaffar marked this pull request as draft May 12, 2025 14:04
@rhaffar rhaffar marked this pull request as ready for review May 12, 2025 17:28
@fdosani
Copy link
Member
fdosani commented May 12, 2025

@rhaffar thanks for flagging and fixing. LGTM

@fdosani fdosani merged commit 45aa745 into develop May 12, 2025
39 checks passed
9F44
@fdosani fdosani deleted the compare_different_length_data branch May 16, 2025 13:51
@fdosani fdosani mentioned this pull request May 16, 2025
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.

Snowflake Compare - apparent mismatch between similarly typed columns of different sizes.
2 participants
0