Skip to content

Fix primitive entrypoint#1891

Merged
jeff-hernandez merged 23 commits intomainfrom
fix-primitive-entrypoint
Feb 11, 2022
Merged

Fix primitive entrypoint#1891
jeff-hernandez merged 23 commits intomainfrom
fix-primitive-entrypoint

Conversation

@jeff-hernandez
Copy link
Copy Markdown
Contributor

@jeff-hernandez jeff-hernandez commented Feb 9, 2022

Using featuretools_primtives as an entry point to load external primitive results in an error because we attempt to iterate over the module.

  File "/Users/jeff.hernandez/Code/featuretools/featuretools/primitives/__init__.py", line 33, in <module>
    for primitive in loaded:
TypeError: 'module' object is not iterable

This fix iterates over the keys in the module to extract primitive objects.

@jeff-hernandez jeff-hernandez marked this pull request as ready for review February 9, 2022 21:19
@jeff-hernandez jeff-hernandez requested review from a team and rwedge February 9, 2022 21:19
Comment on lines +44 to +46
if primitive.__name__ in scope:
error = f"primitive with name \"{primitive.__name__}\" already exists"
raise RuntimeError(error)
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.

If we want to be more specific, we can include which modules contain the conflicting primitives.

@rwedge
Copy link
Copy Markdown
Contributor

rwedge commented Feb 9, 2022

Can we add a test case similar to what we do with the plugin_tests?

I was thinking we'd update the test folder structure like this:

  • featuretools/
    • tests/
      • entry_point_tests/
        • plugin_tests/
        • primitive_tests/

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 9, 2022

Codecov Report

Merging #1891 (26bf433) into main (a8604d5) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1891   +/-   ##
=======================================
  Coverage   98.76%   98.77%           
=======================================
  Files         147      148    +1     
  Lines       16307    16354   +47     
=======================================
+ Hits        16106    16153   +47     
  Misses        201      201           
Impacted Files Coverage Δ
featuretools/primitives/__init__.py 100.00% <100.00%> (ø)
...eaturetools/tests/entry_point_tests/test_plugin.py 100.00% <100.00%> (ø)
...retools/tests/entry_point_tests/test_primitives.py 100.00% <100.00%> (ø)
featuretools/tests/entry_point_tests/utils.py 100.00% <100.00%> (ø)

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 a8604d5...26bf433. Read the comment docs.

@jeff-hernandez
Copy link
Copy Markdown
Contributor Author

@rwedge ready for review

Copy link
Copy Markdown
Contributor

@rwedge rwedge left a comment

Choose a reason for hiding this comment

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

LGTM

@jeff-hernandez jeff-hernandez merged commit b5f0251 into main Feb 11, 2022
@jeff-hernandez jeff-hernandez deleted the fix-primitive-entrypoint branch February 11, 2022 16:09
@dvreed77 dvreed77 mentioned this pull request Feb 11, 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.

3 participants