question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Batch property updates fail

See original GitHub issue

Python version: 3.8 ipyleaflet version: 0.13.1 used in a vanilla Jupyter notebook

A question, not a bug: I have a layer group of ~3000 polylines, which I need to re-style in response to user input. I’m only learning ipyleaflet, so I do it naïvely in a loop:

for obj_id, obj_data in data:  # len(data) > 3000
    line: ipyleaflet.Polyline = self._obj_lines[obj_id]

    if obj_data["x"] > user_input:
    	line.color = 'red'
    	line.weight = 10
    else:
    	line.color = 'black'
    	line.weight = 1

Sometimes (not always) these updates get stuck half-way (see the GIF; no line is supposed to stay blue) and nothing short of recreating the whole map object helps, certainly not re-executing the update code.

My guess is that this approach generates too many individual update messages between the kernel and the front-end which leads to some communication breakdown or state discrepancy. If that is correct, what are the better options from the Python side?

  • is it possible to manually trigger “state synchronization” to ensure update completion?
  • can/should I manually batch updates?
  • should I switch to a GeoJSON layer? (GeoData doesn’t seem to support dynamic styling, if I’m correct)

ipyleaflet

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
martinRenoucommented, Jul 31, 2020

This looks like a different issue. Would you mind opening another issue and provide some code to reproduce?

1reaction
martinRenoucommented, Jul 24, 2020

This piece of code should work indeed. The following PR should fix it: #658. I tried locally and could see it working but if you have time to try it out too that would be greatly appreciated 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

BatchUpdateException error occurred executing batch update ...
Errors "BatchUpdateException error occurred executing batch update of persistent properties" is seen in ApplicationLog. log after update of ...
Read more >
Contact / Company Batch Update via API - with "ignore failing ...
Hello, we are trying to batch update our contacts & companies in Hubspot via the API. As it can happen that the values...
Read more >
Batch request fail on updated metadata, despite ... - GitHub
Hi, We have an issue, in a business application, consuming an OData service, using Simple.OData.Client. The issue is, that our application ...
Read more >
MySQL Bugs: #96623: batch update with ...
Bug #96623, batch update with rewriteBatchedStatements&useServerPrepStmts send fail request. Submitted: 22 Aug 2019 17:17, Modified: 23 Aug 2019 10:34.
Read more >
Hibernate - Batch update returned unexpected row count from ...
I am unable to find the line which causes the issue since hibernate flush the session at the end of the transaction. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found