Skip to content

Commit d77050c

Browse files
committed
3.5.0
1 parent 902767c commit d77050c

File tree

5 files changed

+26
-10
lines changed

5 files changed

+26
-10
lines changed

CHANGELOG.md

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

3+
## v3.5.0 (2024-03-15)
4+
5+
### Updates
6+
7+
* included `pandas` and `IPython` install requirements
8+
* optional required import of `psycopg2` only if in `server_mode`
9+
310
## v3.2.5 (2023-12-07)
411

512
### Updates

README.rst

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

194194
::
195195

196-
twine upload dist/pystackql-3.2.5.tar.gz
196+
twine upload dist/pystackql-3.5.0.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.2.5'
29+
release = '3.5.0'
3030

3131

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

pystackql/stackql.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
_get_version,
99
_format_auth
1010
)
11-
import sys, subprocess, json, os, asyncio, functools, psycopg2
11+
import sys, subprocess, json, os, asyncio, functools
1212
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
13-
from psycopg2.extras import RealDictCursor
1413
import pandas as pd
1514

1615
from io import StringIO
@@ -257,12 +256,20 @@ def __init__(self,
257256
except OSError as e:
258257
raise ValueError(f"Unable to create the log directory {log_dir}: {str(e)}")
259258

260-
if self.server_mode:
261-
# server mode, connect to a server via the postgres wire protocol
262-
self.server_address = server_address
259+
if self.server_mode:
260+
# server mode, connect to a server via the postgres wire protocol
261+
# Attempt to import psycopg2 only if server_mode is True
262+
global psycopg2, RealDictCursor
263+
try:
264+
import psycopg2
265+
from psycopg2.extras import RealDictCursor
266+
except ImportError:
267+
raise ImportError("psycopg2 is required in server mode but is not installed. Please install psycopg2 and try again.")
268+
269+
self.server_address = server_address
263270
self.server_port = server_port
264-
# establish the connection
265-
self._conn = self._connect_to_server()
271+
# establish the connection
272+
self._conn = self._connect_to_server()
266273
else:
267274
# local mode, executes the binary locally
268275
self.params = []

setup.py

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

1111
setup(
1212
name='pystackql',
13-
version='3.2.5',
13+
version='3.5.0',
1414
description='A Python interface for StackQL',
1515
long_description=readme,
1616
author='Jeffrey Aven',
@@ -21,6 +21,8 @@
2121
# include_package_data=True,
2222
install_requires=[
2323
'requests',
24+
'pandas',
25+
'IPython',
2426
],
2527
# entry_points={
2628
# 'console_scripts': [

0 commit comments

Comments
 (0)