-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
InternalsRelated to non-user accessible pandas implementationRelated to non-user accessible pandas implementationRefactorInternal refactoring of codeInternal refactoring of code
Description
While working in #29799, it was quite hard to add a new return value from lib.infer_dtype
. There are many places where we do something like
inferred_dtype = lib.infer_dtype(values)
if inferred_dtype == "string":
...
if inferred_dtype in {"datetime", "integer"}
...
It was hard to grep for these. Could we instead define an enum
class InferredType(enum.Enum):
STRING: "string"
INTEGER: "intger"
MIXED_INTEGER: "mixed-integer"
...
And then return InferredType.INTEGER
, and update all our checks for
if inferred_dtype == InferredType.INTEGER
I think this should be entirely backwards compatible, since we're still just returning the string.
jorisvandenbossche, alimcmaster1, MarianD and vovavili
Metadata
Metadata
Assignees
Labels
InternalsRelated to non-user accessible pandas implementationRelated to non-user accessible pandas implementationRefactorInternal refactoring of codeInternal refactoring of code