Skip to content

Allow passing entities without relationships to CFM#1290

Merged
rwedge merged 5 commits into
mainfrom
lenient-cfm-relationships
Dec 30, 2020
Merged

Allow passing entities without relationships to CFM#1290
rwedge merged 5 commits into
mainfrom
lenient-cfm-relationships

Conversation

@rwedge

@rwedge rwedge commented Dec 30, 2020

Copy link
Copy Markdown
Contributor

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

codecov Bot commented Dec 30, 2020

Copy link
Copy Markdown

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.

@rwedge
rwedge requested a review from tamargrey December 30, 2020 18:56
# 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
Copy Markdown
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
Copy Markdown
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

@rwedge
rwedge requested a review from tamargrey December 30, 2020 20:08

@tamargrey tamargrey left a comment

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.

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