| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…arameter (32-bit) Signed-off-by: Shubhambhusate <bhusates6@gmail.com>
|
Hi @msrathore-db Can you please review the PR |
Sorry, something went wrong.
Adding @jprakash-db for review as he has more context on the same |
Sorry, something went wrong.
|
Hi @jprakash-db Can you please review this PR? |
Sorry, something went wrong.
There was a problem hiding this comment.
A minor comment on test, will also let Jothi also take a look
Sorry, something went wrong.
|
Overall LGTM. |
Sorry, something went wrong.
|
Hi @jprakash-db Do we have any ETA for the PR to be merged, and the fix will be available? |
Sorry, something went wrong.
|
@Shubhambhusate Looks like the creds are not available in this forked branch to run the e2e. Let me run them manually and I will update the status here |
Sorry, something went wrong.
|
@Shubhambhusate We have merged it , thanks for the contribution |
Sorry, something went wrong.
|
Hi @jprakash-db Thanks for merging it. Could you please let me know when the fix will be available to the user? |
Sorry, something went wrong.
|
@Shubhambhusate We are going to cut a release in this week tentatively, so you can expect by coming Monday |
Sorry, something went wrong.
|
Thanks for the update. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
…arameter (32-bit)
What type of PR is this?
Description
dbsql_parameter_from_primitive() in src/databricks/sql/parameters/native.py currently maps Python's float type to FloatParameter, which binds values as Databricks SQL FLOAT (32-bit single-precision). However, Python's float is a 64-bit IEEE 754 double-precision number, so this mapping silently truncates precision.
This PR changes the inference to use DoubleParameter instead, which binds values as Databricks SQL DOUBLE (64-bit) and correctly preserves the full precision of Python floats.
Before (buggy):
cursor.execute("INSERT INTO t (val) VALUES (?)", [12345.678901234]) # Stored as 12345.0 — precision lost silentlyAfter (fixed):
cursor.execute("INSERT INTO t (val) VALUES (?)", [12345.678901234]) # Stored as 12345.678901234 — full precision preservedHow is this tested?
All 55 unit tests in tests/unit/test_parameters.py pass, including test_inference[DoubleParameter-Primitive.FLOAT].
Manually verified that parameterized queries with raw Python floats now preserve full 64-bit precision when inserted into DOUBLE columns.
Related Tickets & Documents