plotly / plotly/dash

infinite recursion error whenever I remove rows from that dataframe and then try to update the table

Open
#1,676 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug dash-data-table P3
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

dash                      1.20.0
dash-bootstrap-components 0.12.2
dash-core-components      1.16.0
dash-html-components      1.1.3
dash-renderer             1.9.1
dash-table                4.11.3
  • if frontend related, tell us your Browser, Version and OS

    • OS: Fedora 33
    • Browser: Firefox
    • Version 89

Describe the bug

Using an App Callback to update the values of a dash table. Whenever I enter a Df.to_dict('records') as is, the table generates fine. However, whenever I remove rows from that dataframe and then try to update the table, I get an infinite recursion error. This only happens with one of my dataframes, but the tough part about it is that a dataframe with all those original values + more worked with the update, so this new frame should too. Through much debugging and stepping through the dash code I still can't come to a conclusion, its hard to find where the infinite recursion even happens because I was able to step through the entire process myself in very little time.

Expected behavior

New datatable updated output without giving infinite recursion error

Screenshots

Debug Output:
RangeError: Maximum call stack size exceeded

at RegExp.[Symbol.replace] (<anonymous>)

at String.replace (<anonymous>)

at tx.trim (http://localhost:8050/_dash-component-suites/dash_renderer/polyfill@7.v1_9_1m1617900226.8.7.min.js:1:34947)

at parseInt (http://localhost:8050/_dash-component-suites/dash_renderer/polyfill@7.v1_9_1m1617900226.8.7.min.js:1:29631)

at s.t.handleResize (http://localhost:8050/_dash-component-suites/dash_table/async-table.js:2:286415)

at s.t.handleResize (http://localhost:8050/_dash-component-suites/dash_table/async-table.js:2:286480)

at s.t.handleResize (http://localhost:8050/_dash-component-suites/dash_table/async-table.js:2:286480)

at s.t.handleResize (http://localhost:8050/_dash-component-suites/dash_table/async-table.js:2:286480)

at s.t.handleResize (http://localhost:8050/_dash-component-suites/dash_table/async-table.js:2:286480)

at s.t.handleResize (http://localhost:8050/_dash-component-suites/dash_table/async-table.js:2:286480)

Here is the dict that is supposed to be updated to the data value of the table
[{'DATE': 'Apr 14 2021', 'DESCRIPTION': 'DEPOSIT IRS TREAS ', 'CREDIT': '1400.00'}, {'DATE': 'Apr 05 2021', 'DESCRIPTION': 'DEPOSIT TAX REF IRS TREAS ', 'CREDIT': '2582.00'}]

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

Use the reported Dash 1.20.0 environment and the callback that assigns Df.to_dict('records') after rows are removed. Start with dash_table's async-table.js at handleResize and the browser stack trace; done means the updated table renders without the recursive handleResize or maximum call stack error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, react
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.