Skip to content

15 attributeerror list object has no attribute items#16

Merged
mzur merged 4 commits intomainfrom
15-attributeerror-list-object-has-no-attribute-items
Nov 4, 2025
Merged

15 attributeerror list object has no attribute items#16
mzur merged 4 commits intomainfrom
15-attributeerror-list-object-has-no-attribute-items

Conversation

@dbrembilla
Copy link
Contributor

Addresses #15

To test this you can use a volume with one image with at least one point annotation and another without any. Change the imageChunkSize in PtpJob.php to 1. On main, you get the error referenced in the Issue. With this branch, we avoid processing chunks that are empty.

If inside a chunk of images there are no point annotations, the point to
polygon script failed.
We should avoid attempting to process such a chunk of image altogether.
@dbrembilla dbrembilla self-assigned this Oct 31, 2025
@dbrembilla dbrembilla requested a review from mzur October 31, 2025 07:12
Copy link
Member

@mzur mzur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you please also add a test case for this?

@dbrembilla dbrembilla requested a review from mzur October 31, 2025 08:29
@mzur mzur linked an issue Nov 3, 2025 that may be closed by this pull request
Copy link
Member

@mzur mzur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good thanks.

You should always use the factory method for DB models in the tests. If there is an error for images because of a duplicate filename, you can still set a different filename with the factory method.

The first argument of assertEquals() is always the expected value. Otherwise the error message will be the wrong way around.

I fixed these in ab18f32

@mzur mzur merged commit 09515cc into main Nov 4, 2025
2 checks passed
@mzur mzur deleted the 15-attributeerror-list-object-has-no-attribute-items branch November 4, 2025 11:50
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.

AttributeError: 'list' object has no attribute 'items'

2 participants