From d51fcb604f9e4a0f9b7d4178d4c85209594afbde Mon Sep 17 00:00:00 2001 From: Ben Fasoli Date: Wed, 25 Mar 2020 18:51:56 -0700 Subject: [PATCH] Replace `cls` argument with `self` Not sure if this was originally intended to be a `@classmethod` but it's now written and called as a method bound to an instance of the class. --- dataset/types.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dataset/types.py b/dataset/types.py index 46f5550..320bc48 100644 --- a/dataset/types.py +++ b/dataset/types.py @@ -16,7 +16,7 @@ class Types(object): date = Date datetime = DateTime - def guess(cls, sample): + def guess(self, sample): """Given a single sample, guess the column type for the field. If the sample is an instance of an SQLAlchemy type, the type will be @@ -25,13 +25,13 @@ class Types(object): if isinstance(sample, TypeEngine): return sample if isinstance(sample, bool): - return cls.boolean + return self.boolean elif isinstance(sample, int): - return cls.bigint + return self.bigint elif isinstance(sample, float): - return cls.float + return self.float elif isinstance(sample, datetime): - return cls.datetime + return self.datetime elif isinstance(sample, date): - return cls.date - return cls.text + return self.date + return self.text