Skip to content

Only allow nonnegative version numbers#2389

Merged
gsheni merged 22 commits into
mainfrom
Fix-version-test-bug
Dec 9, 2022
Merged

Only allow nonnegative version numbers#2389
gsheni merged 22 commits into
mainfrom
Fix-version-test-bug

Conversation

@sbadithe

@sbadithe sbadithe commented Dec 8, 2022

Copy link
Copy Markdown
Contributor
  • The test in question was testing invalid version numbers in the case where the minor version number was 0. The latest release of the packaging library started throwing an error for this case. This PR resolves that by taking the max of (0, minor-1) to prevent negative version numbers.

@sbadithe sbadithe changed the title Try bugfix by only allowing nonnegative version numbers Only allow nonnegative version numbers Dec 8, 2022
@sbadithe sbadithe marked this pull request as ready for review December 8, 2022 01:38
@codecov

codecov Bot commented Dec 8, 2022

Copy link
Copy Markdown

Codecov Report

Merging #2389 (de947f7) into main (722fbe8) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2389      +/-   ##
==========================================
- Coverage   99.50%   99.44%   -0.06%     
==========================================
  Files         322      326       +4     
  Lines       20161    20205      +44     
==========================================
+ Hits        20061    20093      +32     
- Misses        100      112      +12     
Impacted Files Coverage Δ
featuretools/entityset/deserialize.py 100.00% <100.00%> (ø)
featuretools/entityset/serialize.py 100.00% <100.00%> (ø)
featuretools/feature_base/features_deserializer.py 100.00% <100.00%> (ø)
featuretools/feature_base/features_serializer.py 100.00% <100.00%> (ø)
...etools/tests/entityset_tests/test_serialization.py 100.00% <100.00%> (ø)
...ests/primitive_tests/test_feature_serialization.py 100.00% <100.00%> (ø)
...ests/primitive_tests/test_features_deserializer.py 100.00% <100.00%> (ø)
.../tests/primitive_tests/test_features_serializer.py 100.00% <100.00%> (ø)
featuretools/utils/gen_utils.py 100.00% <100.00%> (ø)
featuretools/utils/schema_utils.py 100.00% <100.00%> (ø)
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@gsheni gsheni requested review from a team and thehomebrewnerd December 8, 2022 15:36
@rwedge

rwedge commented Dec 8, 2022

Copy link
Copy Markdown
Contributor

Does it make sense for these tests to be tied to the actual schema version number? Should we mock the schema version instead to get consistent test coverage?

@thehomebrewnerd

Copy link
Copy Markdown
Contributor

@sbadithe When you pull in the latest changes from main you should also update pyproject.toml to remove the upper bound restriction on packaging.


from packaging.version import parse

from featuretools.version import ENTITYSET_SCHEMA_VERSION, FEATURES_SCHEMA_VERSION

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this refactor, we no longer have to import the schema version conditionally inside the function to avoid a circular import error -- we can just do it at the top

Comment thread featuretools/utils/gen_utils.py Outdated
@@ -43,23 +44,22 @@ def find_descendents(cls):

def check_schema_version(cls, cls_type):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove in favor of function in schema_utils.py

@gsheni gsheni merged commit 42d11a9 into main Dec 9, 2022
@gsheni gsheni deleted the Fix-version-test-bug branch December 9, 2022 15:03
@thehomebrewnerd thehomebrewnerd mentioned this pull request Dec 9, 2022
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.

4 participants