Skip to content

Conversation

@willcmartin
Copy link
Contributor

Reference Issue

Fixes #1100 and #1058

What does this PR implement/fix? Explain your changes.

Previously, if class_labels attribute of task is None when __repr__ was called, a NoneType error was thrown. Now "# of Classes" is not printed if there are no class_labels.

How should this PR be tested?

Any other comments?

I followed the implementation suggestion from #1100 where "# of Classes" is ignored. Let me know if this is no longer the best solution to this issue.

Copy link
Collaborator

@mfeurer mfeurer left a comment

Choose a reason for hiding this comment

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

This looks good to me. @PGijsbers since you created the original issue, would you be happy with this fix?

@PGijsbers
Copy link
Collaborator

Yep! Sorry for the late response @willcmartin, but the contribution is much appreciated 🎉

@PGijsbers PGijsbers merged commit 953f84e into openml:develop Oct 7, 2022
PGijsbers added a commit to Mirkazemi/openml-python that referenced this pull request Feb 23, 2023
…l#1148)

* fix nonetype error during print for tasks without class labels

* fix openml#1100/openml#1058 nonetype error

Co-authored-by: Pieter Gijsbers <[email protected]>
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.

TypeError raised by trying to get the __repr__ of a locally created task

3 participants