Fix/blob text renders as hex - #329
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bytes/bytearray/memoryviewresult values as UTF-8 before building the Arrow backend; fall back to0x…hex only when the bytes are not valid UTF-8. Text stored in BLOB columns (for example JSON in a MySQLmediumblob) renders as text again, and theVvalue viewer detects JSON and opens tree mode.vcell-preview tooltip value inrich.text.Textso Textual does not parse cell content as Rich markup. Previously a value containing a closing-tag shape such as"[/api/v1]"raisedMarkupErrorfrom the hover timer and exited the app.Fixes #328.
Changes
sqlit/shared/ui/widgets_tables.py:normalize_arrow_valuetriesraw.decode("utf-8")and returns hex onUnicodeDecodeError. Invalid UTF-8 keeps the behaviour introduced for TUI crashes on raw binary result columns with UnicodeDecodeError after v1.6.3 upgrade #322.sqlit/domains/results/ui/mixins/results.py:_show_cell_tooltipassignsText(tooltip_value)instead of the bare string.tests/ui/test_uuid_fastdatatable.py:bytes,bytearray, andmemoryview.add_rowsrender as the decoded string.action_view_cellon a JSON blob containing[/api/v1]sets aTexttooltip with the decoded payload.Test plan
Manual: against a MySQL table with a
mediumblobcolumn holding JSON, runSELECT, confirm the cell shows the JSON text, pressvand confirm the preview appears without crashing, pressVand confirm tree mode opens.