Skip to content

Commit cfc712d

Browse files
committed
3.5.5
1 parent 33b24f2 commit cfc712d

File tree

6 files changed

+24
-5
lines changed

6 files changed

+24
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Miscellaneous
22
/.stackql
33
/.stackql/*
4+
.pypirc
45

56
/.vscode
67
/.vscode/*

CHANGELOG.md

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

3+
## v3.5.5 (2024-04-17)
4+
5+
### Updates
6+
7+
* modified dict response for `executeStmt`
8+
39
## v3.5.4 (2024-04-11)
410

511
### Updates

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 dist/pystackql-3.5.4.tar.gz
197+
twine upload dist/pystackql-3.5.5.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.5.4'
29+
release = '3.5.5'
3030

3131

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

pystackql/stackql.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ def _run_query(self, query):
219219
}
220220
output["exception"] = f"ERROR: {json.dumps(error_details)}"
221221

222+
# output = {'data': <stdout str>, 'error': <stderr str>, 'exception': <exception as a json string> }
223+
# for a statement you would expect 'error' to exist
224+
# for a query you would expect 'data' to exist
225+
# 'exception' in output indicates an error occurred during the execution (statement or query)
226+
222227
return output
223228

224229
def __init__(self,
@@ -482,6 +487,9 @@ def executeStmt(self, query):
482487
else:
483488
return result
484489
else:
490+
# returns either...
491+
# {'error': '<error message>'} if something went wrong; or
492+
# {'message': '<message>'} if the statement was executed successfully
485493
result = self._run_query(query)
486494
if "exception" in result:
487495
return {"error": result["exception"]}
@@ -494,7 +502,7 @@ def executeStmt(self, query):
494502
elif self.output == 'csv':
495503
return message
496504
else:
497-
return [{'message': message}]
505+
return {'message': message}
498506

499507
def execute(self, query, suppress_errors=True):
500508
"""
@@ -508,7 +516,7 @@ def execute(self, query, suppress_errors=True):
508516
suppress_errors (bool, optional): If set to True, the method will return an empty list if an error occurs.
509517
510518
Returns:
511-
dict, pd.DataFrame, or str: The output of the query, which can be a dictionary, a Pandas DataFrame,
519+
list(dict), pd.DataFrame, or str: The output of the query, which can be a list of dictionary objects, a Pandas DataFrame,
512520
or a raw CSV string, depending on the configured output format.
513521
514522
Raises:
@@ -534,6 +542,10 @@ def execute(self, query, suppress_errors=True):
534542
else: # Assume 'dict' output
535543
return result
536544
else:
545+
# returns either...
546+
# {'error': <error json str>} if something went wrong; or
547+
# [{<data>}] if the statement was executed successfully, messages to stderr are ignored
548+
537549
output = self._run_query(query)
538550
if "exception" in output:
539551
return {"error": output["exception"]}

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.5.4',
13+
version='3.5.5',
1414
description='A Python interface for StackQL',
1515
long_description=readme,
1616
author='Jeffrey Aven',

0 commit comments

Comments
 (0)