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

Allow passing entities without relationships to CFM #1290

Merged
merged 5 commits into from Dec 30, 2020

Conversation

rwedge
Copy link
Contributor

@rwedge rwedge commented Dec 30, 2020

Fixes #1287

Before, calculate_feature_matrix would check that bothentities and relationships were not None before creating an entityset with them, which required passing an empty iterable of relationships in order to work with a single entity. This PR changes that by removing that check and relying on the EntitySet init method to handle valdiating the entities and relationships

@rwedge rwedge changed the title Allow passing a single entity without relationships to CFM Allow passing entities without relationships to CFM Dec 30, 2020
@codecov
Copy link

codecov bot commented Dec 30, 2020

Codecov Report

Merging #1290 (91e347d) into main (723662f) will increase coverage by 0.01%.
The diff coverage is 97.91%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1290      +/-   ##
==========================================
+ Coverage   98.36%   98.38%   +0.01%     
==========================================
  Files         134      134              
  Lines       14456    14473      +17     
==========================================
+ Hits        14220    14239      +19     
+ Misses        236      234       -2     
Impacted Files Coverage Δ
featuretools/tests/synthesis/test_dfs_method.py 100.00% <ø> (+0.44%) ⬆️
featuretools/tests/conftest.py 96.59% <96.55%> (-0.02%) ⬇️
...computational_backends/calculate_feature_matrix.py 99.70% <100.00%> (+0.59%) ⬆️
...utational_backend/test_calculate_feature_matrix.py 99.44% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 723662f...91e347d. Read the comment docs.

@@ -142,8 +142,7 @@ def calculate_feature_matrix(features, entityset=None, cutoff_time=None, instanc
# handle loading entityset
from featuretools.entityset.entityset import EntitySet
if not isinstance(entityset, EntitySet):
if entities is not None and relationships is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering--why not keep the check for whether entities is not None here? Is there a world in which having no entities wouldn't end up erroring?

If not, it might be nice to catch this with its own error instead of Entity transactions does not exist in entityset, which is where it gets caught in the test below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, if we catch there we can give a more descriptive error

Copy link
Contributor

@tamargrey tamargrey left a comment

Choose a reason for hiding this comment

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

lgtm!

@rwedge rwedge merged commit df7855f into main Dec 30, 2020
@rwedge rwedge deleted the lenient-cfm-relationships branch December 30, 2020 20:19
@rwedge rwedge mentioned this pull request Dec 31, 2020
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.

relationships is not truly optional in ft.calculate_feature_matrix()
2 participants