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

added additional constructor args #29

Merged
merged 2 commits into from
Dec 6, 2023
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------
Expand Down
19 changes: 19 additions & 0 deletions pystackql/stackql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=',',
Expand Down Expand Up @@ -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(str(execution_concurrency_limit))

# if custom_auth is set, use it
if custom_auth is not None:
authobj, authstr = _format_auth(custom_auth)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down