From 43926f3828643fdd27bb6f60ee3357a14a510d0e Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Thu, 7 Dec 2023 07:17:55 +1100 Subject: [PATCH 1/2] added additional constructor args --- CHANGELOG.md | 6 ++++++ README.rst | 2 +- docs/source/conf.py | 2 +- pystackql/stackql.py | 19 +++++++++++++++++++ setup.py | 2 +- 5 files changed, 28 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 616679f..2bae331 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v3.2.5 (2023-12-07) + +### Updates + + * included `app_root` and `execution_concurrency_limit` options in `StackQL` constructor + ## v3.2.4 (2023-10-24) ### Updates diff --git a/README.rst b/README.rst index 75d618d..1e96db9 100644 --- a/README.rst +++ b/README.rst @@ -193,4 +193,4 @@ To publish the package to PyPI, run the following command: :: - twine upload dist/pystackql-3.2.4.tar.gz + twine upload dist/pystackql-3.2.5.tar.gz diff --git a/docs/source/conf.py b/docs/source/conf.py index 4b0b026..b3721e0 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -26,7 +26,7 @@ # The short X.Y version version = '' # The full version, including alpha/beta/rc tags -release = '3.2.4' +release = '3.2.5' # -- General configuration --------------------------------------------------- diff --git a/pystackql/stackql.py b/pystackql/stackql.py index 0b8f268..2bb2e16 100644 --- a/pystackql/stackql.py +++ b/pystackql/stackql.py @@ -39,6 +39,12 @@ class StackQL: :param download_dir: The download directory for the StackQL executable (defaults to `site.getuserbase()`, not supported in `server_mode`) :type download_dir: str, optional + :param app_root: Application config and cache root path + (defaults to `{cwd}/.stackql`) + :type app_root: str, optional + :param execution_concurrency_limit: Concurrency limit for query execution + (defaults to `1`, set to `-1` for unlimited) + :type execution_concurrency_limit: int, optional :param api_timeout: API timeout (defaults to `45`, not supported in `server_mode`) :type api_timeout: int, optional @@ -204,6 +210,8 @@ def __init__(self, server_address='127.0.0.1', server_port=5466, download_dir=None, + app_root=None, + execution_concurrency_limit=1, output='dict', custom_auth=None, sep=',', @@ -290,6 +298,17 @@ def __init__(self, _setup(self.download_dir, this_os) self.version, self.sha = _get_version(self.bin_path) + # if app_root is set, use it + if app_root is not None: + self.app_root = app_root + self.params.append("--approot") + self.params.append(app_root) + + # set execution_concurrency_limit + self.execution_concurrency_limit = execution_concurrency_limit + self.params.append("--execution.concurrency.limit") + self.params.append(execution_concurrency_limit) + # if custom_auth is set, use it if custom_auth is not None: authobj, authstr = _format_auth(custom_auth) diff --git a/setup.py b/setup.py index 7987bb6..d2825c6 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name='pystackql', - version='3.2.4', + version='3.2.5', description='A Python interface for StackQL', long_description=readme, author='Jeffrey Aven', From cbdac8903cb1db79fc95b7443f906db7934fb872 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Thu, 7 Dec 2023 07:32:09 +1100 Subject: [PATCH 2/2] added additional constructor args --- pystackql/stackql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pystackql/stackql.py b/pystackql/stackql.py index 2bb2e16..161fb13 100644 --- a/pystackql/stackql.py +++ b/pystackql/stackql.py @@ -307,7 +307,7 @@ def __init__(self, # set execution_concurrency_limit self.execution_concurrency_limit = execution_concurrency_limit self.params.append("--execution.concurrency.limit") - self.params.append(execution_concurrency_limit) + self.params.append(str(execution_concurrency_limit)) # if custom_auth is set, use it if custom_auth is not None: