Skip to content
This repository was archived by the owner on Jun 4, 2026. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
c077bed
IMPALA-12149: Adds additional checks to ensure connection arguments (…
jasonmfehr Jun 7, 2023
b8272c6
Issue #518: Fix Cookie handling with Python 3 [from IMPALA-12294]
bartash Aug 1, 2023
e851d81
Add get_view_name support to SQLAlchemy (#511)
huw0 Oct 24, 2023
76f0ba3
Prepare release 0.19.0 (#524)
wzhou-code Nov 22, 2023
fa858a7
Add Knox cookies in default cookies list (#525)
cravani Jan 3, 2024
8860245
Add comment to help Hive users quick start (#521)
NicolasPA Jan 10, 2024
a3d80ef
Support CHAR type in SQLAlchemy (#516)
huw0 Jan 10, 2024
97820e2
Update ImpalaService.thrift (#526)
csringhofer Jan 23, 2024
e4f7bb2
Fix test_sqlalchemy with sqlalchemy 2 (#527)
csringhofer Jan 30, 2024
b941bfc
Support Cursor.rowcount and close finished queries (#528)
csringhofer Jan 30, 2024
b98ffef
Update versioneer to 0.29 (needed for Python 3.12) (#532)
csringhofer Feb 1, 2024
bf538aa
Issue #529: Fix https connection with Python 3.12 (#531)
csringhofer Feb 1, 2024
bcaa1c0
Revert versioneer bump (#533)
csringhofer Feb 2, 2024
747e1da
Remove incorrectly added tox.ini in last commit (#534)
csringhofer Feb 5, 2024
abf89cf
Prepare release 0.20a1 (#537)
csringhofer Mar 13, 2024
bf1f94c
Turn these regex strings into raw strings (#535)
hackermandh Mar 13, 2024
95012ef
Log "Closing operation" at debug level (#539)
csringhofer Apr 15, 2024
d6582ad
Fix SQLAlchemy support for Impala on Python 3.10 (#538)
jvprosser Apr 15, 2024
acbd481
Add tox.ini to help testing with multiple python versions (#530)
csringhofer Apr 16, 2024
7e637df
Logged fake password instead of actual password to avoid leaking sens…
WWakker Aug 7, 2024
9a853c1
Support wildcard http_cookie_names (#509) (#542)
MikaelSmith Aug 7, 2024
a94ef44
Avoid retrying non-idempotent RPCs in binary connections (#549) (#550)
csringhofer Aug 29, 2024
6e2ffa8
Allow skipping utf8 converison in Python3 (#548)
mszjat Aug 29, 2024
ab1398a
Subtract RPC time from sleep in _wait_to_finish (#551)
csringhofer Sep 6, 2024
ea5db6c
Prepare release 0.20a2 (#552)
csringhofer Sep 6, 2024
3955213
Always set ImpalaHttpClient.__preserve_all_cookies (#553)
csringhofer Sep 7, 2024
e4c7616
Prepare release 0.20a3 (#554)
csringhofer Sep 7, 2024
ee959a1
Prepare release 0.20.0 (#559)
csringhofer Jan 29, 2025
f40a042
Restrict bitarray varsion to 2.* (#560)
csringhofer Jan 29, 2025
d36e71e
Allow users to add custom http headers when using hs2-http (#557) (#558)
bartash Jan 29, 2025
377708f
Prepare release 0.21a1 (#561)
csringhofer Jan 30, 2025
2af879f
Bugfix/retry configuration not passed to rpc operations (#564)
paulmayer Feb 5, 2025
a35685a
Add "requests" as test dependency in Python 2.7 (#565)
csringhofer Feb 5, 2025
5041c3a
Fix proxy-authentication headers for Python 3.* and long basic creden…
paulmayer Feb 7, 2025
eb331fd
Make ImpalaConnectionTests.test_retry_dml more reliable (#566)
csringhofer Feb 18, 2025
30f979c
df.to_sql() support for impala + SQLAlchemy: has_table() got an unexp…
jatin-rathour Feb 23, 2025
f9e6c7c
Fix IPv6 address handling in hs2-http2 (#570) (#571)
csringhofer Mar 6, 2025
fc0c85f
Remove versioneer and add Python3.12/3.13 testing (#572)
csringhofer Mar 6, 2025
69fb3a1
Prepare release 0.21a2 (#573)
csringhofer Mar 6, 2025
550fa21
Update Impala Thrift definitions. (#575)
rizaon Mar 11, 2025
f01207b
Prepare release v0.21a3 (#576)
csringhofer Mar 11, 2025
a3e9e7f
Update versions to v0.21a3 (#577)
csringhofer Mar 11, 2025
c8bd026
Prepare release 0.21.0 (#579)
csringhofer Mar 13, 2025
d7b6443
Set supports_statement_cache=False in sqlalchemy (#503) (#582)
csringhofer Jun 25, 2025
74b8ac7
Unpin bitarray dependency on Python 3 (#585) (#588)
csringhofer Jun 26, 2025
4b975de
Add import_dbapi() class method to ImpalaDialect (#580)
csringhofer Jun 26, 2025
cd10ca9
Update build_summary_table function (#578)
rizaon Jun 26, 2025
70518ff
Fallback to winkerberos if kerberos is not available (#587)
csringhofer Jun 26, 2025
95434ee
Change cur fixture to function level (#589)
csringhofer Jun 26, 2025
c14ece5
Prepare release 0.22a1 (#590)
csringhofer Jun 27, 2025
c3ffb79
Fix py2.7 validation during build creation (#591)
csringhofer Jun 30, 2025
ac08966
Prepare release 0.22.0 (#593)
csringhofer Jul 31, 2025
a0da5bf
Add HTTP server verification (#362) (#598)
csringhofer May 5, 2026
833f2d7
Fix test broken on Python 2.7 added in last commit (#599)
csringhofer May 5, 2026
d2c353a
Prepare release 0.23a1 (#600)
csringhofer May 5, 2026
be5ab1a
Allow verifying server using default CA certificates (#601)
csringhofer May 13, 2026
939c421
resilient columnar batch handling in hiveserver2.py (#597)
shatteringlass May 13, 2026
3b07587
IMPALA-14653: Handle STILL_EXECUTING_STATUS (#595)
MikaelSmith May 13, 2026
2423324
Prepare release 0.23a2 (#602)
csringhofer May 13, 2026
85343d3
Prepare release 0.23.0 (#605)
csringhofer May 29, 2026
1cacedf
Remove Python 2.7 and 3.7 support (#469) (#606)
csringhofer May 29, 2026
ee76562
Switch to pyproject.toml (#607)
csringhofer Jun 2, 2026
68d078d
More Python 2 cleanup (#608)
csringhofer Jun 2, 2026
f298f4c
Add direct dependency to pure-sasl (#471) (#603)
csringhofer Jun 2, 2026
dbceaf8
Bump Thrift to 0.23 + fix verify_cert with hs2 (#604) (#609)
csringhofer Jun 2, 2026
f54032a
Fix some warnings during tests (#610)
csringhofer Jun 3, 2026
a332544
Prepare release 0.24a1 (#611)
csringhofer Jun 3, 2026
463554f
Set version to 0.24a1 (#612)
csringhofer Jun 3, 2026
424022f
Remove old build system (#613)
csringhofer Jun 8, 2026
8037c18
Add script to run all tests (#614)
csringhofer Jun 8, 2026
abc9ebb
Prepare release 0.24.0 (#617)
csringhofer Jun 19, 2026
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
98 changes: 98 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,104 @@
Changelog
=========

0.24
------
* **Breaking changes**
- Remove Python 2.7 and <3.8 support (#606)

* **Improvements**
- Switch to pyproject.toml from setup.py (#607)
- Upgrade Thrift to 0.23.0 (#609)
- also unpinned Thrift dependency (>=0.23.0)

* **Bug Fixes**
- Fix non-http SSL connections with verify_cert=True and
ca_cert=None (these were always rejected in 0.23) (#609)

0.23
------
* **Improvements**
- Add HTTP server verification for hs2-http (#598)
- Allow verifying server using default certificates (#601)
- enabled with verify_cert (default False) arg in connect()
- may be turned on by default in a future release

* **Bug Fixes**
- handle expect_more_rows in fetchcolumnar() (#596)
- handle STILL_EXECUTING_STATUS during fetch (#594)

0.22
------
* **Improvements**
- Fallback to winkerberos if kerberos is not available (#587)
- Update build_summary_table function to match impala-shell (#578)
- Unpin bitarray dependency on Python 3 (#588)

* **Bug Fixes**
- sqlalchemy 2 related fixes #580, #582

0.21
------
* **Improvements**
- Remove versioneer and add Python3.12/3.13 testing (#572)
- this is a temporary solution till Python2 support is dropped
as no version of versioneer handles both Python 2.7 and 3.12
- Allow users to add custom http headers when using hs2-http (#557)
- this change is intended to help with testing the server side
- Update Impala Thrift definitions. (#575)
- this helps in testing newer features in Impala

* **Bug Fixes**
- Fix IPv6 address handling in hs2-http protocol
- Fix proxy-authentication headers for Python 3.* and long basic
credential encodings (#562)
- Fix passing retry count configuration to rpc operations (#564)
- Fix has_table() with sqlalchemy2 (#568)

Note that this may be the last release with Python 2.7 support.

0.20
------
* **Improvements**
- Support wildcard http_cookie_names (#509)
- Add Knox cookies in default cookies list (#525)
- Support CHAR type in SQLAlchemy (#516)
- Support Cursor.rowcount and close finished queries (#528)
Note that this is a potentially breaking change. See the PR
for details about the side-effects.
The old behavior can be restored by setting close_finished_queries=False
when creating a Cursor.
Also note that Cursor.rowcount only works with Impala server - with
Hive it will always return -1.
- Allow skipping utf8 conversion in Python3 (#548)
- Subtract RPC time from sleep in _wait_to_finish (#551)
- Reduced logging:
- Log "Closing operation" at debug level (#539)
- Never log passwords in http connections (#545)
- Before the fix passwords were logged at debug level

* **Bug Fixes**
- Avoid retrying non-idempotent RPCs in binary connections (#549)
- Always set ImpalaHttpClient.__preserve_all_cookies (#553)
- Fix https connection with Python 3.12 (#531)
Note that Python 3.12 support is not complete yet.
A known issue is that installing with setuptools fails with Python 3.12.
- Fix SQLAlchemy support for Impala on Python 3.10 (#538)
- Turn regex strings into raw strings (#535)

Note that this may be the last release with Python 2.7 support.

0.19.0
------
* **Improvements**
- Add get_view_name support to SQLAlchemy (#511)
SHOW VIEWS is expected to be supported in Impala soon.
- Add additional checks to ensure connection arguments (#515)

* **Bug Fixes**
- Fix Cookie handling with Python 3 (#518)
- Fix numeric parameter substitution bug (#508)

0.18.0
------
* **Improvements**
Expand Down
9 changes: 7 additions & 2 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ Fork the repo and send a pull request against `master`. Contributions welcome!
rm -rf $IMPYLA_REPO/impala/thrift/*.thrift
```

1. Execute `$IMPYLA_REPO/impala/thrift/process_thrift.sh`
1. `cp $IMPALA_REPO/common/thrift/ImpalaService.thrift $IMPYLA_REPO/impala/thrift`

Hand edit ImpalaService.thrift to exclude files, API and definitions unrelated to query
profile such as Frontend.thrift, BackendGflags.thrift, and Query.thrift.

2. Execute `$IMPYLA_REPO/impala/thrift/process_thrift.sh`

This should only need to be done very irregularly, as the generated code is
committed to the repo. Only when the original thrift IDL files change. People
checking out the repo to develop on it do NOT need to run the codegen. Codegen
performed with Thrift 0.9.x.
performed with Thrift 0.16.x.


#### UDF maintenance
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ include ez_setup.py
include README.md
include LICENSE.txt
include CHANGELOG.md
include versioneer.py
include impala/_version.py
39 changes: 31 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ distributed data sets, see the [Ibis project][ibis].
* HiveServer2 compliant; works with Impala and Hive, including nested data

* Fully [DB API 2.0 (PEP 249)][pep249]-compliant Python client (similar to
sqlite or MySQL clients) supporting Python 2.6+ and Python 3.3+.
sqlite or MySQL clients) supporting Python 3.8+.

* Works with Kerberos, LDAP, SSL
* Works with Kerberos, LDAP, SSL, JWT

* [SQLAlchemy][sqlalchemy] connector

Expand All @@ -26,24 +26,25 @@ experience

Required:

* Python 2.7+ or 3.5+
* Python 3.8+ (Python 2.7 was supported up to Impyla 0.23.0)

* `six`, `bitarray`
* `bitarray`

* `thrift==0.16.0`
* `thrift>=0.23.0`

* `thrift_sasl==0.4.3`

Optional:

* `kerberos>=1.3.0` for Kerberos over HTTP support. This also requires Kerberos libraries
to be installed on your system - see [System Kerberos](#system-kerberos)
* On Windows operating systems an alternative is 'winkerberos' which can be installed with pip

* `pandas` for conversion to `DataFrame` objects; but see the [Ibis project][ibis] instead

* `sqlalchemy` for the SQLAlchemy engine

* `pytest` for running tests; `unittest2` for testing on Python 2.6
* `pytest` and `requests` for running tests; `unittest2` for testing on Python 2.6


#### System Kerberos
Expand Down Expand Up @@ -80,7 +81,7 @@ or clone the repo:
```bash
git clone https://github.com/cloudera/impyla.git
cd impyla
python setup.py install
python -m pip install .
```

#### Running the tests
Expand All @@ -103,6 +104,17 @@ py.test --connect impala

Leave out the `--connect` option to skip tests for DB API compliance.

To test impyla with different Python versions [tox] can be used.
The commands below will run all impyla tests with all supported and
installed Python versions:
```bash
cd path/to/impyla
tox
```
To filter environments / tests use `-e` and [pytest] arguments after `--`:
```bash
tox -e py310 -- -ktest_utf8_strings
```

### Usage

Expand All @@ -111,7 +123,7 @@ Impyla implements the [Python DB API v2.0 (PEP 249)][pep249] database interface

```python
from impala.dbapi import connect
conn = connect(host='my.host.com', port=21050)
conn = connect(host='my.host.com', port=21050) # auth_mechanism='PLAIN' for unsecured Hive connection, see function doc
cursor = conn.cursor()
cursor.execute('SELECT * FROM mytable LIMIT 100')
print cursor.description # prints the result set's schema
Expand Down Expand Up @@ -152,6 +164,16 @@ df = as_pandas(cur)
# carry df through scikit-learn, for example
```

For secure connection set use_ssl=True in connect(). Warning: this doesn't verify the server
by default! To verify server set verify_cert or ca_cart perameter:

```python
# Verify server using system CA certificates:
conn = connect(host='my.host.com', use_ssl=True, verify_cert=True)

# Verify server using custom CA certificate:
conn = connect(host='my.host.com', use_ssl=True, ca_cart="/tmp/my_cert.pem")
```

[pep249]: http://legacy.python.org/dev/peps/pep-0249/
[pandas]: http://pandas.pydata.org/
Expand All @@ -160,6 +182,7 @@ df = as_pandas(cur)
[pytest]: http://pytest.org/latest/
[sqlalchemy]: http://www.sqlalchemy.org/
[ibis]: http://www.ibis-project.org/
[tox]: http://tox.wiki/

# How do I contribute code?
You need to first sign and return an
Expand Down
31 changes: 31 additions & 0 deletions bin/bootstrap_test_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
# Copyright 2026 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Install dependencies to run tests on each supported Python version using tox.

sudo apt install --yes -q python3-pip
python3 -m pip install tox

# Install various python versions.
# Some dependencies in Python 3.8 and 3.9 also need distutils.
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install --yes -q python3.8 python3.8-dev python3.8-distutils
sudo apt install --yes -q python3.9 python3.9-dev python3.9-distutils
sudo apt install --yes -q python3.10 python3.10-dev
sudo apt install --yes -q python3.11 python3.11-dev
sudo apt install --yes -q python3.12 python3.12-dev
sudo apt install --yes -q python3.13 python3.13-dev
sudo apt install --yes -q python3.14 python3.14-dev
77 changes: 77 additions & 0 deletions bin/run_tests_in_impala_dev_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/bash
# Copyright 2026 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Run all tests by restarting Impala cluster with different authentication flags.
# TODO: move this to tox or something like CustomClusterTest in Impala?

set -eu

TOX_ENV_ARGS=""
if [[ -n "${1:-}" ]]; then
TOX_ENV_ARGS="-e $1"
fi

if [[ -z "$IMPALA_HOME" ]]; then
echo "Must provide IMPALA_HOME in environment" 1>&2
exit 1
fi
if [[ -z "$IMPYLA_HOME" ]]; then
echo "Must provide IMPYLA_HOME in environment" 1>&2
exit 1
fi

. "$IMPALA_HOME/bin/impala-config.sh"
. "$IMPALA_HOME/bin/set-pythonpath.sh"

unset IMPYLA_TEST_AUTH_MECH
unset IMPYLA_SSL_CERT
unset IMPYLA_SSL_WRONG_CERT


# Run tests without SSL and authentication.
$IMPALA_HOME/bin/start-impala-cluster.py
unset IMPYLA_REPORT_PREFIX
set +e
python3 -m tox $TOX_ENV_ARGS
ret=$?
set -e

# Run tests with SSL enabled.
export IMPALA_SSL_CERT_DIR=$IMPALA_HOME/be/src/testutil
export IMPYLA_SSL_CERT=$IMPALA_SSL_CERT_DIR/server-cert.pem
export IMPALA_SSL_ARGS="--ssl_client_ca_certificate=$IMPYLA_SSL_CERT --ssl_server_certificate=$IMPYLA_SSL_CERT --ssl_private_key=$IMPALA_SSL_CERT_DIR/server-key.pem --hostname=localhost"
export IMPYLA_SSL_WRONG_CERT=$IMPALA_SSL_CERT_DIR/incorrect-commonname-cert.pem
$IMPALA_HOME/bin/start-impala-cluster.py --impalad_args="$IMPALA_SSL_ARGS" --catalogd_args="$IMPALA_SSL_ARGS" --state_store_args="$IMPALA_SSL_ARGS"
export IMPYLA_REPORT_PREFIX="ssl-"
set +e
python3 -m tox $TOX_ENV_ARGS -- -m ssl
ret=$(( ret != 0 ? ret : $? ))
set -e


unset IMPYLA_SSL_CERT
unset IMPYLA_SSL_WRONG_CERT

export IMPYLA_TEST_AUTH_MECH=JWT
$IMPALA_HOME/bin/start-impala-cluster.py --impalad_args="--jwt_token_auth=true --jwt_validate_signature=false --jwt_allow_without_tls=true"
export IMPYLA_REPORT_PREFIX="jwt-"
set +e
python3 -m tox $TOX_ENV_ARGS -- -m jwt_auth
ret=$(( ret != 0 ? ret : $? ))
set -e

exit $ret


Loading