Skip to content

Conversation

@windelbouwman
Copy link
Contributor

This requests a redraw on the table when updating data from a background task.

Refs #3046

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@HalfWhitt
Copy link
Member

HalfWhitt commented Nov 23, 2025

Thanks for the contribution! This doesn't seem to be working quite right. The test_row_change test in the testbed is crashing on one of the added lines:

index = self._data.index(item)
            ^^^^^^^^^^^^^^^^
AttributeError: 'TableSource' object has no attribute 'index'

And indeed, the TableSource class has no such method (though presumably it could be added)

class TableSource:
def __init__(self, interface):
self.interface = interface
def __len__(self):
return len(self.interface.data)
def __getitem__(self, index):
row = self.interface.data[index]
title, subtitle, icon = (
getattr(row, attr, None) for attr in self.interface.accessors
)
return Row(title=(icon, title), subtitle=subtitle)

I haven't gone poking at this myself, so I can't comment yet on the viability of your approach otherwise, or whether or how it fixes the issue mentioned, but it needs to at least not fail any existing tests.

Speaking of testing, when we fix a bug, we need to make sure we're adding a test that confirms it's fixed. Trying it out by hand can verify it once, but it we also need to make sure it never regresses without us noticing. So for this, we'd need a test that updates the table from a background task, then verifies that the table is in fact displaying the correct thing.


The Read the Docs failure seems unrelated. @freakboy3742 or @kattni, any idea if some of our recent standardizing updates borked that somehow? It says it fails because beeware-docs-tools requires setuptools-scm==9.2.2 and we require setuptools-scm==9.2.0. But I don't see a 9.2.0 requirement anywhere in Toga; they're all 9.2.2, except Demo and Textual, which are 8.1.0 for some reason.

I'm also unsure about the other failure in the Windows testbed:

 mkdir -p testbed/app_data
  cp -r "$HOME\AppData\Local\Tiberius Yak\Toga Testbed\Data" testbed/app_data/testbed-app_data-windows
  shell: C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
  env:
    min_python_version: 3.10
    FORCE_COLOR: 1
    pythonLocation: C:\hostedtoolcache\windows\Python\3.12.10\x64
    PKG_CONFIG_PATH: C:\hostedtoolcache\windows\Python\3.12.10\x64/lib/pkgconfig
    Python_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.12.10\x64
    Python2_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.12.10\x64
    Python3_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.12.10\x64
cp: cannot stat '/c/Users/runneradmin\AppData\Local\Tiberius Yak\Toga Testbed\Data': No such file or directory

I don't see how crashing on a table-editing test could make that happen...

@HalfWhitt
Copy link
Member

Kattni pointed out (on Discord) that I was only looking at requirements, not in main; this PR was missing the most recent commit, which updated them. Merging it in fixes the docs issue.

However, the Windows testbed error is being reproduced on #3904, so that's definitely not caused by anything here.

@johnzhou721
Copy link
Contributor

johnzhou721 commented Nov 23, 2025

@HalfWhitt @windelbouwman

The WinForms intermittent failure is caused by one of my earlier PRs not having a sufficient delay, and there's an immediate fix in #3904. If this is really impacting things on this branch, go ahead and apply this change:

Screenshot 2025-11-22 at 22 12 36

to this PR, and whatever PR gets merged first will have it made into main.

EDIT -- Winforms tests are failing here, but when I read the logs they're not for the same reason as #3904 Winforms fails. But if I missed some sort of CI log where the WinForms CI freezes at about 15ish minutes, then the above is it.

@johnzhou721
Copy link
Contributor

@HalfWhitt FYI -- seems that the "Copy App Generated Data" or something like that always fails when anything in the main test suite fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants