Skip to content

Support for enforcing embedded schema - #505

Merged
jprakash-db merged 2 commits into
release/v3.7.3from
jprakash-db/enforce-schema
Feb 19, 2025
Merged

jprakash-db merged 2 commits into
release/v3.7.3from
jprakash-db/enforce-schema

Conversation

@jprakash-db

Copy link
Copy Markdown
Contributor

Description

As a part of query optimization Databricks returns cached results when the underlying query is the same. This creates issue when the same query is used but with a different alias, in this case the result is the same but the metadata is different. But Databricks returns the same metadata as a part of query optimisation

Added

Added option to enforce schema to make sure the metadata is in updated state

Comment thread src/databricks/sql/client.py Outdated
self,
operation: str,
parameters: Optional[TParameterCollection] = None,
enforceEmbeddedSchema=False,

@jackyhu-db jackyhu-db Feb 18, 2025 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you rename it to enforce_embedded_schema_correctness to be consistent with the meaning of the thrift API. "enforce schema" is different with "enforce schema with correctness". And please use snake case which is python style.

@jprakash-db
jprakash-db merged commit 72b0044 into release/v3.7.3 Feb 19, 2025
cathleeny added a commit that referenced this pull request Nov 25, 2026
The kernel now folds _port into the connection host (databricks-sql-kernel
#505), so the driver no longer rewrites server_hostname. The session passes
server_hostname through unchanged and the parsed _port as the binding's
port= kwarg.

The driver keeps what is driver-specific: _port parsing (falsy means the
default, invalid values raise ValueError), _connection_uri resolution into
host, port and path, the OAuth origin guard, and redaction of its own error
messages.

port= is sent only when a non-default port applies, so the default path
sends the same kwargs as before. A wheel without the kwarg raises
NotSupportedError instead of silently connecting to port 443.

Removed the driver-side folding rules (embedded-port-wins and its warning,
path/userinfo/IPv6 checks, _split_host). Kernel InvalidArgument errors now
surface as ProgrammingError rather than ValueError.

KERNEL_REV is pinned to 22ae6ec250837b38d0e3dc720310d4dcfb81fa98 so the
kernel-e2e workflow builds the kernel with port support. This PR needs a
kernel release that includes databricks-sql-kernel#505.

Signed-off-by: Cathleen Yan <[email protected]>
Co-authored-by: Isaac <[email protected]>

This branch had an error being deployed

1 failed deployment
azure-prod — e94c3fc3 Deployed Feb 18, 2025 by jprakash-db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants