Skip to content

Commit a6b7b7d

Browse files
authored
Merge pull request #47 from stackql/feature/updates
added http_debug arg
2 parents 63cfbaf + 1eb00f6 commit a6b7b7d

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

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.7.1 (2024-11-19)
4+
5+
### Updates
6+
7+
- Added `http_debug` constructor argument to return HTTP log information
8+
39
## v3.7.0 (2024-11-08)
410

511
### Updates

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 StackQL Studios
3+
Copyright (c) 2022-2025 StackQL Studios
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

pystackql/stackql.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ def __init__(self,
297297
page_limit=20,
298298
max_depth=5,
299299
debug=False,
300+
http_debug=False,
300301
debug_log_file=None):
301302
"""Constructor method
302303
"""
@@ -315,6 +316,7 @@ def __init__(self,
315316
raise ValueError("CSV output is not supported in server mode, use 'dict' or 'pandas' instead.")
316317

317318
self.debug = debug
319+
318320
if debug:
319321
if debug_log_file is None:
320322
self.debug_log_file = os.path.join(os.path.expanduser("~"), '.pystackql', 'debug.log')
@@ -442,6 +444,12 @@ def __init__(self,
442444
self.params.append("--apirequesttimeout")
443445
self.params.append(str(api_timeout))
444446

447+
if http_debug:
448+
self.http_debug = True
449+
self.params.append("--http.log.enabled")
450+
else:
451+
self.http_debug = False
452+
445453
# proxy settings
446454
if proxy_host is not None:
447455
self.proxy_host = proxy_host
@@ -624,6 +632,9 @@ def execute(self, query, suppress_errors=True, custom_auth=None, env_vars=None):
624632
# [{'error': <error json str>}] if something went wrong; or
625633
# [{<row1>},...] if the statement was executed successfully, messages to stderr
626634

635+
if self.http_debug:
636+
suppress_errors = False
637+
627638
output = self._run_query(query, custom_auth=custom_auth, env_vars=env_vars)
628639

629640
if "exception" in output:

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

0 commit comments

Comments
 (0)