visgl / visgl/deck.gl

Pydeck layer serialization strips internal quotes

Open
#4,507 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature pydeck
Dominant language
TypeScript
Stars
14.6k
Forks
2.3k
Avg merge
2d 9h
Merged PRs (30d)
42

Description

cc @ajduberstein

Description

When passing a string to Pydeck, all internal (double) quote characters are removed. This prevents passing JSON data as a string to JS.

Repro Steps

Note that this can be reproduced solely in Python. I.e. before doing any serialization, the quotes have already been stripped.

import pydeck as pdk
json_str = '"{"hello":"world"}"'
layer = pdk.Layer(
    "Layer",
    None,
    json=json_str)
layer
{"@@type": "Layer",
 "id": "6e7e67aa-7b5c-47ab-928f-508fb6af892e",
 "json": "{hello:world}"}

I would expect escaped \" to exist in the internal string object

Environment (please complete the following information):
  • Framework Version: master
  • Browser Version: Chrome latest
  • OS: Mac
Logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the pdk.Layer entry point shown in the Python reproduction and run it to inspect the string before and after layer serialization. Trace where the json argument is transformed; done means internal double quotes remain escaped in the serialized layer output so JSON strings can be passed to JavaScript.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.