-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Handle decimal types in query results #6837
Handle decimal types in query results #6837
Conversation
Since getredash#6687, we don't serialize query results as JSON before returning them. This is fine, except for the query results data source which needs to pass the data directly to sqlite3, and doesn't know how to do that with the decimal types that are occasionally returned by (at least) the PostgreSQL query runner: https://www.psycopg.org/docs/faq.html#problems-with-type-conversions
} | ||
table_name = "query_123" | ||
create_table(connection, table_name, results) | ||
connection.execute("SELECT 1 FROM query_123") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified that this fails without the above fix applied.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6837 +/- ##
=======================================
Coverage 63.42% 63.43%
=======================================
Files 163 163
Lines 13203 13206 +3
Branches 1823 1824 +1
=======================================
+ Hits 8374 8377 +3
Misses 4531 4531
Partials 298 298
|
@eradman @justinclift Can you take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds sensible to me. 😄
Since getredash#6687, we don't serialize query results as JSON before returning them. This is fine, except for the query results data source which needs to pass the data directly to sqlite3, and doesn't know how to do that with the decimal types that are occasionally returned by (at least) the PostgreSQL query runner: https://www.psycopg.org/docs/faq.html#problems-with-type-conversions
What type of PR is this?
Description
Since #6687, we don't serialize query results as JSON before returning them. This is fine, except for the
query results data source which needs to pass the data directly to sqlite3, and doesn't know how to
do that with the decimal types that are occasionally returned by (at least) the PostgreSQL query runner:
https://www.psycopg.org/docs/faq.html#problems-with-type-conversions
How is this tested?
Related Tickets & Documents
N/A
Mobile & Desktop Screenshots/Recordings (if there are UI changes)