Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
d4bb854
fix: keep zero and millisecond REST temporal values
aminghadersohi Sep 26, 2026
4ef4584
feat: reflect Drill view definitions
aminghadersohi Sep 26, 2026
ce0be20
fix: accept boolean verify_ssl URL values
aminghadersohi Sep 26, 2026
6f6954b
feat: opt-in REST timeout, query cancel and busy-server absence proof
aminghadersohi Sep 26, 2026
4a9ca25
fix: verify TLS by default, bound streamed memory, recover pooled con…
aminghadersohi Sep 26, 2026
f4488b7
Merge pull request #10 from preset-io/fix-rest-temporal-decoding
aminghadersohi Sep 26, 2026
5d18512
fix: reflect dynamic-schema plugin columns and prove missing MongoDB …
aminghadersohi Sep 26, 2026
30ead36
fix: address post-release review of 1.1.11.4
aminghadersohi Sep 26, 2026
c751d72
feat: cancel a group of statements chosen before execution
aminghadersohi Sep 26, 2026
4dec7e5
test: isolate the unreachable-server live test on its own connection
aminghadersohi Sep 26, 2026
31d0618
fix: decode FLOAT columns as floats and reflect VARDECIMAL as DECIMAL…
aminghadersohi Sep 26, 2026
412ae11
ci: verify plain branch builds without publishing instead of failing …
aminghadersohi Sep 26, 2026
7d55186
Merge branch 'fix-post-merge-review' into fix-decimal-float-decoding
aminghadersohi Sep 26, 2026
ab1f2d2
Merge pull request #12 from preset-io/fix-post-merge-review
aminghadersohi Sep 26, 2026
39b88b0
Merge remote-tracking branch 'origin/master' into fix-decimal-float-d…
aminghadersohi Sep 26, 2026
96ff311
Merge pull request #13 from preset-io/fix-decimal-float-decoding
aminghadersohi Sep 29, 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
123 changes: 122 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,124 @@
## [1.1.11.6] - unreleased

### Fixed

- REST results decoded DOUBLE and FLOAT columns as `Decimal`, and NaN,
Infinity and -Infinity as the strings `'NaN'`, `'Infinity'` and
`'-Infinity'`, although the cursor description reports FLOAT. FLOAT4 and
FLOAT8 values are now Python floats (or `None`).
- Reflection of DECIMAL columns in file-backed tables (for example Parquet)
returned `UserDefinedType`, because Drill reports them as
`VARDECIMAL(p, s)`. They now reflect as `DECIMAL(p, s)`, and the REST
cursor description carries the precision and scale.

## [1.1.11.5] - unreleased

### Fixed

- Reflection of dynamic-schema plugins such as Kafka returned only the
`**` placeholder column that INFORMATION_SCHEMA publishes for them. When
that placeholder is the only column, the real columns are now read from a
`SELECT * ... LIMIT 1` probe, as for file-backed tables.
- A missing MongoDB collection raised the probe's `DatabaseError` from
`has_table()` and autoload. Absence is now proven, like missing files, by a
missing-object diagnostic plus a fresh, complete, unlimited and nonempty
`INFORMATION_SCHEMA.TABLES` listing of the database that lacks the name;
empty, limited or failed listings still preserve the original error.
- An HTTPS login whose certificate fails verification now raises
`TransportError` explaining that certificates are verified by default since
1.1.11.4 and naming the fix (`verify_ssl=<path to the CA bundle>`), instead
of a bare SSL error. Verification is never disabled automatically.
- Query-profile reads for guarded absence used a fixed 30 s timeout per
request (up to seven requests plus about 5 s of sleeps). The whole poll now
shares one budget: the connection's `request_timeout`, else 30 s.
- The cancellation tag was per cursor, so `Cursor.cancel()` could reach a
different statement from the same cursor. Every `execute()` now uses a
fresh tag; `cancel()` only reaches the cursor's latest statement and returns
`False` before the first `execute()`.
- `get_view_definition()` without a schema and without a database in the URL
bound `TABLE_SCHEMA = NULL` and never matched. It now searches all schemas
and requires a unique match (`InvalidRequestError` if the view name exists
in several schemas).
- When `request_timeout` expires, the driver now cancels the timed-out
statement on the server (found by its tag) instead of leaving it running.

### Added

- `Cursor.cancel_group` (optional, 32 lowercase hex characters) marks every
statement the cursor runs with a shared ID in addition to its own tag, and
`Connection.cancel_query_group(id)` cancels whichever of them is running.
This suits callers that must choose a cancel ID before execution starts,
such as a SQL editor's "Stop" button, possibly from another connection.

## [1.1.11.4] - unreleased

### Breaking change

- **HTTPS connections now verify the server certificate by default.** With
`use_ssl=true` and no `verify_ssl`, 1.1.11.3 and earlier encrypted without
checking the certificate; 1.1.11.4 checks it against the system trust store.
A server with a self-signed or private-CA certificate that previously
connected now fails verification. Migrate by setting
`verify_ssl=<path to the CA bundle that signed the server certificate>` in
the connection URL (or the `connect()` argument). `verify_ssl=false` restores
the old unverified behaviour and is not recommended.

### Fixed

- REST DATE, TIME and TIMESTAMP values equal to zero epoch milliseconds
(1970-01-01, midnight, 1970-01-01 00:00:00) were returned as `None`. Only a
JSON null now decodes to `None`.
- REST TIME and TIMESTAMP values keep their millisecond fraction instead of
being truncated to whole seconds.

- A `verify_ssl=true` / `verify_ssl=false` URL value was passed to requests as
the string, which requests reads as a CA bundle path, so `verify_ssl=true`
failed with "Could not find a suitable TLS CA certificate bundle". Boolean
spellings now become booleans; any other value is still a CA bundle path.
(Correction: an earlier version of this note said the default was
unchanged. It is not; see "Breaking change" below.)

- A provably absent file-backed table could surface as the opaque
`DatabaseError` instead of `False` / `NoSuchTableError` on a busy server:
the failed query's profile was read for only about 0.3 s before its error
was published. The profile is now polled with backoff for about 5 s. The
opaque REST error text is still never treated as evidence, because
permission and other failures produce the same text.
- `Cursor.get_query_id()` raised `AttributeError`; it now returns the query
ID once Drill has sent it, else `None`.

- TLS certificates are now verified by default when `use_ssl` is set
(system trust store). `verify_ssl=<CA bundle path>` selects a CA bundle and
`verify_ssl=false` explicitly disables verification (logged as a warning).
Previously an HTTPS connection without `verify_ssl` accepted any certificate.
- A streamed query no longer reads its whole response body into memory:
a debug log statement evaluated `Response.text` for every query, so
`stream_results` had no effect and memory grew with the result size. The
body is also parsed in 64 KiB chunks instead of one byte at a time.
- REST transport failures (connection errors, resets, timeouts, including
mid-stream) raise DB-API `TransportError` (an `OperationalError`) instead of
raw `requests` exceptions, and the dialect reports them and closed
connections as disconnects. `pool_pre_ping` and SQLAlchemy invalidation now
replace a pooled connection whose HTTP session failed or was closed, instead
of handing it out and failing the first statement.
- `Cursor.close()` works after its connection was closed or invalidated.

### Added

- Opt-in `request_timeout=<seconds>` connection option (URL query parameter)
applied to every REST request; a timeout raises `OperationalError`. Without
it nothing changes: there is no client-side limit, as before.
- `Cursor.cancel()` cancels the statement the cursor is running, including
before Drill has sent any result (for example a long aggregation). Every
cursor statement carries a leading `/* sqlalchemy-drill:<tag> */` comment
with a per-cursor tag (`Cursor.query_tag`); `cancel()` finds that unique tag
in Drill's running-query list and calls `/profiles/cancel/{queryId}`.
`Connection.cancel_query(query_id)` and `Connection.cancel_tagged_query(tag)`
are also available, e.g. to cancel from another connection.
- `get_view_definition()` returns the stored view SQL from
`INFORMATION_SCHEMA.VIEWS` (bound schema and view name) instead of raising
`NotImplementedError`; an unknown view raises `NoSuchTableError`.

## [1.1.11.3] - unreleased

### Fixed
Expand Down Expand Up @@ -89,7 +210,7 @@
`verify_ssl` defaults to `False`, so `use_ssl=True` alone encrypts without
authenticating the server. Pass `verify_ssl=True` for a trusted connection.
This is long-standing behaviour and is unchanged here; changing the default
is a separate breaking change.
is a separate breaking change. (Superseded: 1.1.11.4 verifies by default.)
- JDBC and ODBC still inherit `driver == "rest"` from the base dialect. That is
wrong for both transports, but correcting public dialect metadata is a visible
API change that deserves its own review rather than riding along with this
Expand Down
14 changes: 10 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
// is deliberately NOT a stable release. A PR build can
// never emit the bare stable version; this is asserted
// below rather than left to convention.
// * other branches (the branch job that runs next to a PR's pr-head job)
// -> 1.1.11.1+branch.<shortsha>; tests and the wheel build
// run, nothing is published.
//
// 1.1.11.1 sorts ABOVE a hypothetical upstream 1.1.11, so it must never be
// offered to a dependency resolver as a candidate for the plain
Expand Down Expand Up @@ -113,8 +116,11 @@ podTemplate(

if (isPullRequest) {
publishVersion = "${baseVersion}+${env.BRANCH_NAME}.${shortGitRev}"
} else {
} else if (isMaster) {
publishVersion = baseVersion
} else {
// Plain branch builds verify but never publish.
publishVersion = "${baseVersion}+branch.${shortGitRev}"
}

// A stable release may only come from reviewed, merged history.
Expand All @@ -134,8 +140,8 @@ podTemplate(
returnStdout: true,
label: 'Normalize publish version'
).trim()
if (isPullRequest && !publishVersion.contains('+')) {
error("PR build produced a non-local version ${publishVersion}; refusing.")
if (!isMaster && !publishVersion.contains('+')) {
error("Non-master build produced a non-local version ${publishVersion}; refusing.")
}

wheelName = "${DIST_NAME}-${publishVersion}-py3-none-any.whl"
Expand Down Expand Up @@ -188,7 +194,7 @@ podTemplate(

container('py-ci') {
stage('Build and verify') {
if (isPullRequest) {
if (!isMaster) {
sh(
script: "sed -i \"s/__version__ = '${baseVersion}'/__version__ = '${publishVersion}'/\" sqlalchemy_drill/__init__.py",
label: 'Apply pre-release version'
Expand Down
2 changes: 1 addition & 1 deletion sqlalchemy_drill/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

__version__ = '1.1.11.3'
__version__ = '1.1.11.6'
from sqlalchemy.dialects import registry

registry.register("drill", "sqlalchemy_drill.sadrill", "DrillDialect_sadrill")
Expand Down
Loading
Loading