Skip to content

Skip encoding params for explain query#821

Merged
albertyw merged 1 commit intojazzband:masterfrom
albertyw:fix-explain-params
Sep 9, 2025
Merged

Skip encoding params for explain query#821
albertyw merged 1 commit intojazzband:masterfrom
albertyw:fix-explain-params

Conversation

@albertyw
Copy link
Copy Markdown
Member

@albertyw albertyw commented Sep 7, 2025

Fixes #819
Reverts #798 , #807

@glennmatthews the _explain_query switched from using the raw params to string params as of #798 . Since the params here are only used for executing the query and are not later saved to a DB like in execute_sql, I'm not sure why params needed to be force_stred? As in #819, some database fields are binary and either cannot be decoded (fixed in the try/catch) or should not be decoded even if they can be decoded.

@albertyw albertyw changed the title Skip serialization on explain query Skip encodingon explain query Sep 7, 2025
@albertyw albertyw changed the title Skip encodingon explain query Skip encoding params for explain query Sep 7, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.15%. Comparing base (23a8da2) to head (a11d58c).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #821      +/-   ##
==========================================
+ Coverage   87.04%   87.15%   +0.10%     
==========================================
  Files          53       53              
  Lines        2169     2164       -5     
==========================================
- Hits         1888     1886       -2     
+ Misses        281      278       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread silk/sql.py
Comment on lines 63 to 64
result = _unpack_explanation(cur.fetchall())
return '\n'.join(result)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It might be that these lines are actually the part that's problematic for non-UTF-8 data? Looking at #798 and specifically the initial commit of 584a6e2, it was wrapping all three lines here in the try/except at first.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Looking at #819 , the error people are getting seem to be an error from the postgresql database itself. That would only happen in the cur.execute() so the exception happens before these two lines are even reached.

@albertyw
Copy link
Copy Markdown
Member Author

albertyw commented Sep 9, 2025

Merging this in given the confirmation from #819 (comment)

@albertyw albertyw merged commit 1f05b54 into jazzband:master Sep 9, 2025
91 checks passed
@albertyw albertyw deleted the fix-explain-params branch September 9, 2025 06:39
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.

Getting django.db.utils.DataError: invalid input syntax for type json in django-silk versions 5.4.2 and 5.4.1

2 participants