Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #34

Merged
merged 4 commits into from
Jul 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ language: python

matrix:
include:
- python: 2.6
env: TOXENV=python2.6
- python: 2.7
env: TOXENV=python2.7
- python: 3.3
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DataProperty>=0.5.4
DataProperty>=0.7.0
jsonschema
pathvalidate>=0.4.2
path.py
Expand Down
2 changes: 1 addition & 1 deletion requirements/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest
pytest-cov
pytest
tox
XlsxWriter
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

setuptools.setup(
name="SimpleSQLite",
version="0.4.1",
version="0.4.2",
url="https://github.com/thombashi/SimpleSQLite",
bugtrack_url="https://github.com/thombashi/SimpleSQLite/issues",

Expand All @@ -48,7 +48,6 @@
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
Expand Down
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
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = python{2.6,2.7,3.3,3.4,3.5}
envlist = python{2.7,3.3,3.4,3.5}

[testenv]
deps =
Expand Down