[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Error handling for invalid dataset type when creating models. #2328

Merged
merged 5 commits into from
Sep 20, 2019
Merged

Error handling for invalid dataset type when creating models. #2328

merged 5 commits into from
Sep 20, 2019

Conversation

jakesabathia2
Copy link
Collaborator
@jakesabathia2 jakesabathia2 commented Sep 18, 2019

Just add one line to check the datatype for sframe,
since some codes don't check datatype for the dataset before passing it into _find_only_column_of_type()
Close #1978

@@ -90,6 +90,7 @@ def _find_only_column_of_type(sframe, target_type, type_name, col_name):
raised. The name and type of the target column should be provided as
strings for the purpose of error feedback.
"""
_raise_error_if_not_sframe(sframe,"dataset")
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the sframe variable is not an SFrame, this will raise an error message claiming the name of the input parameter was "dataset". I don't think we want to assume the input parameter will always be name "dataset".

Sadly, I think we'll need to add this check to each .create method that doesn't already have it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just fixed all files which didn't check the type error.

Copy link
Collaborator
@TobyRoseman TobyRoseman left a comment

Choose a reason for hiding this comment

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

This is a great change. Thanks for adding it.

@@ -220,6 +220,8 @@ def create(dataset, target, feature=None, model = 'resnet-50',
ImageClassifier
"""
start_time = _time.time()
if not isinstance(dataset,_tc.SFrame):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: you should have a space after the comma.

@@ -101,6 +101,8 @@ def create(dataset, label = None, feature = None, model = 'resnet-50', verbose =
[500 rows x 4 columns]
"""
start_time = _time.time()
if not isinstance(dataset,_tc.SFrame):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: same as previous comment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just fixed it

Copy link
Collaborator
@nickjong nickjong left a comment

Choose a reason for hiding this comment

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

Here too use https://help.github.com/en/articles/closing-issues-using-keywords to refer the #1978, and give the PR and commit message more descriptive text

@jakesabathia2 jakesabathia2 changed the title Issue #1978 close #1978 Sep 20, 2019
@jakesabathia2 jakesabathia2 changed the title close #1978 Close #1978 Sep 20, 2019
@jakesabathia2 jakesabathia2 changed the title Close #1978 Error handling for invalid dataset type when creating models. Sep 20, 2019
@jakesabathia2 jakesabathia2 merged commit 5387a17 into apple:master Sep 20, 2019
@jakesabathia2 jakesabathia2 deleted the visualization_branch branch September 20, 2019 18:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Graceful error message for annotations on SArray input with no image_column set
3 participants