Skip to content

Commit

Permalink
Replace function calls which no longer supported
Browse files Browse the repository at this point in the history
  • Loading branch information
thombashi committed Jul 9, 2016
1 parent 1b43871 commit 93480b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion simplesqlite/loader/csv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ def __init__(self, source):
self.encoding = "utf-8"

def _to_data_matrix(self):
from dataproperty.type import FloatTypeChecker

return [
[
six.b(data).decode(self.encoding, "ignore")
if not dataproperty.is_float(data) else data
if not FloatTypeChecker(data).is_type() else data
for data in row
]
for row in self._csv_reader
Expand Down
7 changes: 6 additions & 1 deletion simplesqlite/sqlquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,16 @@ def to_value_str(cls, value):
>>> SqlQuery.to_value_str(None)
'NULL'
"""
from dataproperty.type import IntegerTypeChecker
from dataproperty.type import FloatTypeChecker

if value is None:
return "NULL"

if dataproperty.is_integer(value) or dataproperty.is_float(value):
if any([
IntegerTypeChecker(value).is_type(),
FloatTypeChecker(value).is_type()
]):
return str(value)

return "'%s'" % (value)
Expand Down

0 comments on commit 93480b1

Please sign in to comment.