Skip to content

Commit 9585400

Browse files
authored
Merge pull request #37 from stackql/feature/updates
v3.6.1
2 parents 5fb7348 + 99423f4 commit 9585400

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Changelog
22

3-
## v3.6.0 (2024-04-18)
3+
## v3.6.1 (2024-04-18)
44

55
### Updates
66

77
* modified dict response for `executeStmt`
8-
* modified error response for `execute`
8+
* modified error response for `execute`, should never return `None`
99

1010
## v3.5.4 (2024-04-11)
1111

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,4 @@ To publish the package to PyPI, run the following command:
194194

195195
::
196196

197-
twine upload --config-file .pypirc dist/pystackql-3.6.0.tar.gz
197+
twine upload --config-file .pypirc dist/pystackql-3.6.1.tar.gz

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = ''
2828
# The full version, including alpha/beta/rc tags
29-
release = '3.6.0'
29+
release = '3.6.1'
3030

3131

3232
# -- General configuration ---------------------------------------------------

pystackql/stackql.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,10 @@ def execute(self, query, suppress_errors=True):
580580
return pd.DataFrame([{"error": "Invalid JSON output"}])
581581
else: # Assume 'dict' output
582582
try:
583-
return json.loads(data)
583+
retval = json.loads(data)
584+
if retval is None:
585+
return []
586+
return retval
584587
except ValueError:
585588
return [{"error": f"Invalid JSON output : {data}"}]
586589

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name='pystackql',
13-
version='3.6.0',
13+
version='3.6.1',
1414
description='A Python interface for StackQL',
1515
long_description=readme,
1616
author='Jeffrey Aven',

tests/pystackql_tests.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,15 @@ def test_10b_executeStmt_with_pandas_output(self):
193193
@pystackql_test_setup()
194194
def test_11_execute_with_defaults(self):
195195
result = self.stackql.execute(google_query)
196-
is_valid_dict = isinstance(result, list) and all(isinstance(item, dict) for item in result)
197-
self.assertTrue(is_valid_dict, f"Result is not a valid dict: {result}")
198-
print_test_result(f"Test execute with defaults\nRESULT: {result}", is_valid_dict)
196+
is_valid_data_resp = isinstance(result, list) and all(isinstance(item, dict) for item in result)
197+
self.assertTrue(is_valid_data_resp, f"Result is not valid: {result}")
198+
print_test_result(f"Test execute with defaults\nRESULT: {result}", is_valid_data_resp)
199+
200+
def test_11a_execute_with_defaults_null_response(self):
201+
result = self.stackql.execute("SELECT 1 WHERE 1=0")
202+
is_valid_empty_resp = isinstance(result, list) and len(result) == 0
203+
self.assertTrue(is_valid_empty_resp, f"Result is not a empty list: {result}")
204+
print_test_result(f"Test execute with defaults (empty response)\nRESULT: {result}", is_valid_empty_resp)
199205

200206
@pystackql_test_setup(output='pandas')
201207
def test_12_execute_with_pandas_output(self):

0 commit comments

Comments
 (0)