Skip to content

Commit 0eb23b0

Browse files
hotfix
Fixed bug when returning empty resultset as DataFrame
1 parent 2f608e7 commit 0eb23b0

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A wrapper for the MySQL Python connector that provides additional resilience an
66

77
* A wrapper for the MySQL Python connector that provides additional resilience and functionality.
88
* Implements connection pooling that's more reliable.
9-
* Version 1.2.0
9+
* Version 1.2.1
1010
* Works with Python 2.7+ or 3.5+
1111

1212
## How do I get set up? ##

dbconnector/dbconnector.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,7 @@ def _select_query(cnx, **kwargs):
421421
col_regex = "(?<=^select)[a-zA-Z0-9_\s*(),`]+(?=from)"
422422
cols = [c.strip().split(" as ")[-1].strip().strip("`") for c in
423423
re.findall(col_regex, sqlquery.lower())[0].strip().split(",")]
424-
if result[0]:
425-
return DataFrame(result, columns=cols)
426-
else:
427-
return DataFrame({c: [] for c in cols})
424+
return DataFrame(result, columns=cols)
428425
return result
429426

430427
@staticmethod

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# Versions should comply with PEP440. For a discussion on single-sourcing
2323
# the version across setup.py and the project code, see
2424
# https://packaging.python.org/en/latest/single_source_version.html
25-
version="1.2.0",
25+
version="1.2.1",
2626

2727
description="A wrapper for the MySQL Python connector that provides additional resilience and functionality.",
2828
long_description=long_description,
@@ -60,10 +60,10 @@
6060
"Programming Language :: Python :: 2",
6161
"Programming Language :: Python :: 2.7",
6262
"Programming Language :: Python :: 3",
63-
"Programming Language :: Python :: 3.3",
64-
"Programming Language :: Python :: 3.4",
6563
"Programming Language :: Python :: 3.5",
6664
"Programming Language :: Python :: 3.6",
65+
"Programming Language :: Python :: 3.7",
66+
"Programming Language :: Python :: 3.8",
6767
],
6868

6969
# What does your project relate to?

0 commit comments

Comments
 (0)