Binary Transport Data Update Error

Open
#5,966 1 comment 1 reaction 1 assignee View on GitHub

@ajduberstein is already working on this.

Since Jul 9, 2021.

Assessment

This issue has not been assessed yet.

Description

pydeck

I am running into an error in PyDeck when I try to update a layer's data when using binary_transport equal to True.

This error can be reproduced in the 07 - Binary Transport notebook run in the PyDeck Mybinder. Adding the following code at the bottom of the notebook (to update the data)

nodes_layer.data = nodes.iloc[:1000]

gives the following error

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-7-c8e5849254b8> in <module>
----> 1 nodes_layer.data = nodes.iloc[:1000]
      2 r.update()

/usr/local/lib/python3.7/site-packages/pydeck/bindings/layer.py in data(self, data_set)
    125         """
    126         if self.use_binary_transport:
--> 127             self._binary_data = self._prepare_binary_data(data_set)
    128         elif is_pandas_df(data_set):
    129             self._data = data_set.to_dict(orient="records")

/usr/local/lib/python3.7/site-packages/pydeck/bindings/layer.py in _prepare_binary_data(self, data_set)
    153             np_data = np.stack(data_set[column].to_numpy())
    154             # Get rid of the accssor so it doesn't appear in the JSON output
--> 155             del self.__dict__[inverted_accessor_map[column]]
    156             binary_transmission.append(
    157                 {

KeyError: 'get_position'

This error happens before running an update - r.update(). This error does not occur when binary_transport is set to False.

Originally posted by @cornhundred in https://github.com/visgl/deck.gl/discussions/5961#discussioncomment-986695

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

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.

More from visgl/deck.gl

All issues in visgl/deck.gl

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.