deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

Binary Transport Data Update Error

Open cornhundred opened this issue 2 years ago • 1 comments

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

cornhundred avatar Jul 09 '21 20:07 cornhundred

Hello, is there any progress on this issue?

nahidpervez avatar Feb 10 '22 20:02 nahidpervez