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

feat: add options for case-insensitive matching of coltypes and dtypes in schema checks #13

Merged
merged 9 commits into from
Dec 31, 2024

Conversation

rich-iannone
Copy link
Member

@rich-iannone rich-iannone commented Dec 31, 2024

This PR adds the case_sensitive_colnames= and case_sensitive_dtypes= arguments to the col_schema_match() validation method. Both are set to True by default, which doesn't change the previous behavior. Setting any of these to False performs a case-insensitive match during interrogation.

The most important changes include updates to the ColSchemaMatch class, the schema comparison methods, and the col_schema_match() method, as well as new test cases to ensure the correctness of these features.

Enhancements to schema matching:

  • [pointblank/_interrogation.py]: Added case_sensitive_colnames and case_sensitive_dtypes parameters to the ColSchemaMatch class and updated the __post_init__ method to handle these parameters.

Updates to schema comparison methods:

  • [pointblank/schema.py]: Modified schema comparison methods (_compare_schema_columns_complete_in_order, _compare_schema_columns_subset_any_order, etc.) to include case_sensitive_colnames and case_sensitive_dtypes parameters.

Enhancements to the col_schema_match() method:

  • [pointblank/validate.py]: Added case_sensitive_colnames= and case_sensitive_dtypes= parameters to the col_schema_match function and updated the validation logic to handle these parameters.

New test cases:

  • [tests/test_validate.py]: Added new test cases to verify the functionality of the col_schema_match() method with different combinations of case sensitivity settings for column names and data types.

Copy link

codecov bot commented Dec 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.82%. Comparing base (bbee06e) to head (4ab47ae).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
+ Coverage   99.76%   99.82%   +0.06%     
==========================================
  Files          11       11              
  Lines        1696     1724      +28     
==========================================
+ Hits         1692     1721      +29     
+ Misses          4        3       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rich-iannone rich-iannone changed the title Feat: add options for case-insensitive matching of coltypes and dtypes in schema checks feat: add options for case-insensitive matching of coltypes and dtypes in schema checks Dec 31, 2024
@rich-iannone rich-iannone merged commit 34e463d into main Dec 31, 2024
6 checks passed
@rich-iannone rich-iannone deleted the feat-schema-case-sensitive branch December 31, 2024 02:08
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.

1 participant