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

Add __len__ method to ExistsType #1199

Merged
merged 7 commits into from
Jul 3, 2024
Merged

Add __len__ method to ExistsType #1199

merged 7 commits into from
Jul 3, 2024

Conversation

ArVar
Copy link
Contributor

@ArVar ArVar commented Jul 1, 2024

Adds len method to the ExistType like in CategoricalType. Otherwise the ExistType will use the __len__ method of Variable:

    def __len__(self) -> int:
        return 1

and higher_vars won't be expanded correctly in datamodel.py:

        for variable in self.field_variables:
            if len(variable) == 1:
                columns.append(variable)
            elif len(variable) > 1:
                assert hasattr(variable, "higher_vars")
                columns.extend(variable.higher_vars)

Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.78%. Comparing base (f7e131e) to head (2a558db).
Report is 28 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1199      +/-   ##
==========================================
+ Coverage   73.57%   74.78%   +1.21%     
==========================================
  Files          29       29              
  Lines        2293     2217      -76     
==========================================
- Hits         1687     1658      -29     
+ Misses        606      559      -47     

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

remove whitespace
@ArVar
Copy link
Contributor Author

ArVar commented Jul 2, 2024

Hi @fgregg, are the codecov rules a bit too strict?
I haven't seen any test for __len__ in the repo.

@fgregg fgregg merged commit 012acaf into dedupeio:main Jul 3, 2024
23 checks passed
@ArVar ArVar changed the title Add __len__ method to ExistType Add __len__ method to ExistsType Jul 3, 2024
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.

2 participants