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.
This commit is contained in:
parent
0a32b89c01
commit
d51fcb604f
@ -16,7 +16,7 @@ class Types(object):
|
|||||||
date = Date
|
date = Date
|
||||||
datetime = DateTime
|
datetime = DateTime
|
||||||
|
|
||||||
def guess(cls, sample):
|
def guess(self, sample):
|
||||||
"""Given a single sample, guess the column type for the field.
|
"""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
|
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):
|
if isinstance(sample, TypeEngine):
|
||||||
return sample
|
return sample
|
||||||
if isinstance(sample, bool):
|
if isinstance(sample, bool):
|
||||||
return cls.boolean
|
return self.boolean
|
||||||
elif isinstance(sample, int):
|
elif isinstance(sample, int):
|
||||||
return cls.bigint
|
return self.bigint
|
||||||
elif isinstance(sample, float):
|
elif isinstance(sample, float):
|
||||||
return cls.float
|
return self.float
|
||||||
elif isinstance(sample, datetime):
|
elif isinstance(sample, datetime):
|
||||||
return cls.datetime
|
return self.datetime
|
||||||
elif isinstance(sample, date):
|
elif isinstance(sample, date):
|
||||||
return cls.date
|
return self.date
|
||||||
return cls.text
|
return self.text
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user