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

2734 Component Graph Instantiation Error #3569

Merged
merged 7 commits into from
Jun 17, 2022

Conversation

MichaelFu512
Copy link
Contributor

@MichaelFu512 MichaelFu512 commented Jun 15, 2022

Closes #2734.


After creating the pull request: in order to pass the release_notes_updated check you will need to update the "Future Release" section of docs/source/release_notes.rst to include this pull request by adding :pr:123.

@CLAassistant
Copy link

CLAassistant commented Jun 15, 2022

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Jun 15, 2022

Codecov Report

Merging #3569 (1ebed18) into main (e9b93af) will increase coverage by 0.1%.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##            main   #3569     +/-   ##
=======================================
+ Coverage   99.7%   99.7%   +0.1%     
=======================================
  Files        335     335             
  Lines      33253   33260      +7     
=======================================
+ Hits       33124   33131      +7     
  Misses       129     129             
Impacted Files Coverage Δ
evalml/pipelines/component_graph.py 99.8% <100.0%> (+0.1%) ⬆️
...valml/tests/pipeline_tests/test_component_graph.py 99.9% <100.0%> (+0.1%) ⬆️

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 e9b93af...1ebed18. Read the comment docs.

@MichaelFu512 MichaelFu512 marked this pull request as ready for review June 15, 2022 21:32
Copy link
Contributor

@eccabay eccabay left a comment

Choose a reason for hiding this comment

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

Fantastic job getting this up, Michael! I've left a few suggestions for changes, mostly just to follow our conventions.

@@ -2,6 +2,7 @@ Release Notes
-------------
**Future Releases**
* Enhancements
* Using the ``describe`` method on an un-instantiated ComponentGraph now gives a more helpful error message :pr:`3569`
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding this! Personally, I would consider this change a "fix" instead of an "enhancement", since it's patching an existing bug.

Also, [this is a super nitpick and we haven't been doing a great job of maintaining the pattern recently but] generally we try to keep our changes in past tense (v.0.52.0 is a good example of that). So instead, this commend might be something closer to "Added a clearer error message when describe is called on an un-instantiated ComponentGraph"

Comment on lines 27 to 29
# from tkinter import W


Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove these lines completely?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, let's try to refrain from committing any unused, commented code.

}
)
except TypeError:
raise TypeError(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think a different error would be more useful here, a TypeError doesn't necessarily make sense for illegally calling a method. Personally, I always default to a ValueError.

@@ -1685,6 +1685,30 @@ def test_describe_component_graph(return_dict, example_graph, caplog):
assert component.name in out


def test_describe_component_graph_TypeError():
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: function names should be exclusively snake case - typeerror or type_error is just fine in this case.

"y",
],
}
cg_with_estimators = ComponentGraph(component_dict)
Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect test! If you'd like to keep things cleaner and more concise, you can use our example_graph pytest fixture instead of defining your own component dict. You can see examples of how to use it in other parts of this file, for example here.

except TypeError:
raise TypeError(
"You need to instantiate ComponentGraph before calling describe()"
) from None
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need this None here? If not we can remove it!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I don't include from None it spits out 2 error messages rather than one weirdly enough (I'm not entirely sure why it does that).

Copy link
Collaborator

Choose a reason for hiding this comment

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

can you show me the stack trace if you have it?

Copy link
Contributor

@eccabay eccabay left a comment

Choose a reason for hiding this comment

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

Fantastic!

Copy link
Collaborator

@jeremyliweishih jeremyliweishih left a comment

Choose a reason for hiding this comment

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

LGTM - 🚢

@MichaelFu512 MichaelFu512 enabled auto-merge (squash) June 17, 2022 15:52
@MichaelFu512 MichaelFu512 merged commit 856a17c into main Jun 17, 2022
@MichaelFu512 MichaelFu512 deleted the 2734-ComponentGraph-InstantiationError branch June 17, 2022 16:20
MichaelFu512 added a commit that referenced this pull request Jun 17, 2022
* Throws error on describe if uninstantiated

* Added test for Exception

* Fixed linting and added to release_notes

* Made changes that Becca and Jeremy suggested
This was referenced Jun 23, 2022
chukarsten pushed a commit that referenced this pull request Jul 8, 2022
* Tried to implement batch/pipeline timing

* Unpin nlp_primitives but disallow v2.6.0 (#3574)

* Unpin nlp_primitives but disallow v2.60

* Update release_notes.rst

* more constraint / version updates

* 2734 Component Graph Instantiation Error (#3569)

* Throws error on describe if uninstantiated

* Added test for Exception

* Fixed linting and added to release_notes

* Made changes that Becca and Jeremy suggested

* Changed print to log, added function to logger

* Linting is correct

* Added test into test_logger.py

* Added tests for batch time results

* Updated release note

* Tried to fix merge conflict

* Added Jeremy's and Karsten's suggestions

* Simplified tests and added new error check

* Made it so that the dictionary always returns

* Added comments and made code clearer

* Fixed tests for search

* Fixed release_notes

* Fixed release notes

* Update automl_search.py

* Updated docstring

Co-authored-by: Roy Wedge <roy.wedge@alteryx.com>
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.

Issue calling ComponentGraph's describe() method if ComponentGraph is not instantiated
5 participants