Skip to content
Snippets Groups Projects
Commit 0cdb625d authored by Sortofamudkip's avatar Sortofamudkip
Browse files

fixed bool param checks

parent 964dddc9
No related branches found
No related tags found
No related merge requests found
......@@ -232,9 +232,9 @@ class Dataset:
if type(colname) != str:
logging.error("parameter `colname` is not a string")
raise ValueError(f"{colname} is not a string")
if type(ascending) not in (None, bool):
if not (ascending is None or type(ascending) is bool):
logging.error("parameter `ascending` is not a bool or None")
raise ValueError(f"{colname} is not a bool or None")
raise ValueError(f"{ascending} is not a bool or None")
return self.dataframe[colname].sort_values(ascending=ascending)
......@@ -270,9 +270,9 @@ class Dataset:
if type(colname) != str:
logging.error("parameter `colname` is not a string")
raise ValueError(f"{colname} is not a string")
if type(ascending) not in (None, bool):
if not (ascending is None or type(ascending) is bool):
logging.error("parameter `ascending` is not a bool or None")
raise ValueError(f"{colname} is not a bool or None")
raise ValueError(f"{ascending} is not a bool or None")
grouped_size = self.dataframe.groupby(colname).size()
return (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment