We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ff488a commit 646ff0bCopy full SHA for 646ff0b
pandas/core/dtypes/base.py
@@ -214,6 +214,8 @@ def construct_from_string(cls, string: str):
214
... raise TypeError("Cannot construct a '{}' from "
215
... "'{}'".format(cls.__name__, string))
216
"""
217
+ if not isinstance(string, str):
218
+ raise TypeError("Expects a string, got {}".format(type(string)))
219
if string != cls.name:
220
raise TypeError("Cannot construct a '{}' from '{}'".format(
221
cls.__name__, string))
0 commit comments