Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON fields containing unicode escape sequences are potentially rendered incorrectly #635

Open
5 of 13 tasks
gcmurphy-snyk opened this issue Aug 28, 2024 · 1 comment
Open
5 of 13 tasks
Labels
bug Something isn't working

Comments

@gcmurphy-snyk
Copy link

Before Proceeding, please acknowledge:

  • I have consulted the Troubleshooting guide.
  • I have searched Issues and Discussions in this repo.
  • Feature requests should be initiated as Discussions. This is a bug report.

Describe the bug

Any json field loaded from duckdb containing \n or other escape sequences may not be displayed as expected by harlequin. Leading new line characters look as empty values.

To Reproduce
Steps to reproduce the behavior.

Given this file example.json:

{                                                                                                                                                                                   
  "example": "normal entry",                                                                                                                                                        
  "hidden": "\n this is hidden",                                                                                                                                                    
  "emoji": "\uD83D\uDCA9"                                                                                                                                                           
}

Run the query:

select * from read_json_auto('example.json')

Expected behavior
Screenshot 2024-08-28 at 12 02 59 PM

Actual behavior

Screenshot 2024-08-28 at 12 03 50 PM

(The text in the hidden field is not visible)

Contributing
Are you interested in contributing a fix?

  • Yes
  • Maybe
  • No

Additional context
Please provide as much as you can, but don't waste your time if it's definitely not relevant or you don't know.

What is the output of harlequin --version?

$ harlequin --version
harlequin, version 1.20.0

Installed Adapters:
  - duckdb, version 1.20.0
  - sqlite, version 1.20.0

What database adapter are you using with Harlequin? (Default is duckdb)

duckdb

What other options are you using when invoking Harlequin? (If you are using a profile, please add relevant items from your profile here).

Can you tell us more about your system?

  • Shell: zsh + tmux

  • Terminal:
    Screenshot 2024-08-28 at 12 09 47 PM

  • OS of the shell: Darwin MC22XQ24G7 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:46 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6031 arm64

  • OS of the terminal (if different from the shell): N/A

  • Default locale / language for your OS/Terminal/Shell: en-AU

Tip

For example, for my system, these are:

  • Bash
  • Windows Terminal
  • Ubuntu 22.04 / WSL2
  • Windows 11
  • en_US/UTF-8

How did you install Harlequin?

  • pipx
  • conda/mamba
  • pip (global install)
  • pip + venv/virtualenv or pipenv
  • Poetry
  • uv/Rye
  • other: _____________
@tconbeer
Copy link
Owner

Thanks for the issue. The data table is truncating everything after the first line for each cell (So "foo\nbar" renders as "foo"). Escaping might be a good idea (and easier than supporting multiple lines per record).

@tconbeer tconbeer added the bug Something isn't working label Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants