Skip to content

Commit fe26127

Browse files
authored
Merge pull request #39 from stackql/feature/updates
added rowsaffected to executeStmt
2 parents 9585400 + c284225 commit fe26127

13 files changed

+26
-29
lines changed

.github/workflows/test.yaml

+10-19
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ jobs:
1919
- "3.10"
2020
- "3.11"
2121
- "3.12"
22+
# - "3.13"
2223
exclude:
23-
- os: windows-latest
24-
python-version: "3.12"
24+
- os: macos-latest
25+
python-version: "3.7"
2526
runs-on: ${{matrix.os}}
2627
name: 'Run Tests on ${{matrix.os}} with Python ${{matrix.python-version}}'
2728

@@ -33,6 +34,10 @@ jobs:
3334
with:
3435
python-version: ${{ matrix.python-version }}
3536

37+
- name: Upgrade pip
38+
if: matrix.os == 'macos-latest'
39+
run: python${{ matrix.python-version }} -m pip install --upgrade pip
40+
3641
- name: Install dependencies from requirements.txt
3742
shell: bash
3843
run: |
@@ -42,27 +47,13 @@ jobs:
4247
- name: Install psycopg2 for non-Windows OS
4348
if: matrix.os != 'windows-latest'
4449
run: |
45-
pip install psycopg2
50+
pip install psycopg2-binary
4651
4752
# Windows specific
48-
# whl files downloaded from https://www.lfd.uci.edu/~gohlke/pythonlibs/#psycopg
49-
- name: Install psycopg2-binary for Windows using local wheel
53+
- name: Install psycopg2-binary for Windows
5054
if: matrix.os == 'windows-latest'
5155
run: |
52-
# Determine the wheel filename based on the Python version
53-
$wheelFilename = switch ("${{ matrix.python-version }}") {
54-
"3.7" { "psycopg2-2.9.3-cp37-cp37m-win_amd64.whl" }
55-
"3.8" { "psycopg2-2.9.3-cp38-cp38-win_amd64.whl" }
56-
"3.9" { "psycopg2-2.9.3-cp39-cp39-win_amd64.whl" }
57-
"3.10" { "psycopg2-2.9.3-cp310-cp310-win_amd64.whl" }
58-
"3.11" { "psycopg2-2.9.3-cp311-cp311-win_amd64.whl" }
59-
}
60-
61-
# Print the wheel filename for debugging
62-
Write-Host "Determined wheel filename: $wheelFilename"
63-
64-
# Install the wheel
65-
pip install ./tests/whls/$wheelFilename
56+
pip install psycopg2-binary
6657
shell: powershell
6758
# End Windows specific
6859

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## v3.6.2 (2024-05-06)
4+
5+
### Updates
6+
7+
* added `rowsaffected` to dict response for `executeStmt`
8+
39
## v3.6.1 (2024-04-18)
410

511
### Updates

README.rst

+1-1
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 --config-file .pypirc dist/pystackql-3.6.1.tar.gz
197+
twine upload --config-file .pypirc dist/pystackql-3.6.2.tar.gz

docs/source/conf.py

+1-1
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.6.1'
29+
release = '3.6.2'
3030

3131

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

pystackql/stackql.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,11 @@ def executeStmt(self, query):
514514
elif self.output == 'csv':
515515
return message
516516
else:
517-
return {'message': message}
517+
# count number of rows in the message
518+
try:
519+
return {'message': message, 'rowsaffected': message.count('\n')}
520+
except Exception as e:
521+
return {'message': message, 'rowsaffected': 0}
518522

519523
def execute(self, query, suppress_errors=True):
520524
"""

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name='pystackql',
13-
version='3.6.1',
13+
version='3.6.2',
1414
description='A Python interface for StackQL',
1515
long_description=readme,
1616
author='Jeffrey Aven',

tests/pystackql_tests.py

-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ def setUpModule():
4141
print("downloading aws provider for tests...")
4242
res = PyStackQLTestsBase.stackql.executeStmt(registry_pull_aws_query)
4343
print(res)
44-
print("downloading awscc provider for tests...")
45-
res = PyStackQLTestsBase.stackql.executeStmt(registry_pull_awscc_query)
46-
print(res)
4744
print("downloading google provider for tests...")
4845
res = PyStackQLTestsBase.stackql.executeStmt(registry_pull_google_query)
4946
print(res)

tests/test_params.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def get_custom_download_dir(platform_name):
2727

2828
registry_pull_google_query = "REGISTRY PULL google"
2929
registry_pull_aws_query = "REGISTRY PULL aws"
30-
registry_pull_awscc_query = "REGISTRY PULL awscc"
3130
registry_pull_okta_query = "REGISTRY PULL okta"
3231
registry_pull_github_query = "REGISTRY PULL github"
3332

@@ -44,7 +43,7 @@ def registry_pull_resp_pattern(provider):
4443

4544
aws_query = f"""
4645
SELECT
47-
SPLIT_PART(CreationDate, '-', 1) as year, count(*) as num_buckets FROM aws.s3.buckets
46+
SPLIT_PART(CreationDate, '-', 1) as year, count(*) as num_buckets FROM aws.s3_api.buckets
4847
WHERE region = 'us-east-1'
4948
GROUP BY year
5049
"""
@@ -54,7 +53,7 @@ def registry_pull_resp_pattern(provider):
5453
async_queries = [
5554
f"""
5655
SELECT region, COUNT(*) as num_functions
57-
FROM awscc.lambda.functions
56+
FROM aws.lambda.functions
5857
WHERE region = '{region}'
5958
"""
6059
for region in regions
Binary file not shown.
Binary file not shown.
Binary file not shown.
-1.34 MB
Binary file not shown.
-1.34 MB
Binary file not shown.

0 commit comments

Comments
 (0)