Skip to content

Address issue where dictionary size changed during iteration - #246

Merged
bsipocz merged 5 commits into
astropy:mainfrom
cthoyt:patch-1
Sep 21, 2026
Merged

bsipocz merged 5 commits into
astropy:mainfrom
cthoyt:patch-1

Conversation

@cthoyt

@cthoyt cthoyt commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

I did some initial exploring and figured out that a size changed during iteration error got triggered for a names dictionary corresponding to a Pydantic model, but in my case (cthoyt/sssom-pydantic#171) it's happening for a model that my code changes don't touch

this fix at least makes sure that the size doesn't change during iteration, but there might be something deeper going on


🫀 No generative artificial intelligence was used to produce the code and text for this contribution; only human intelligence

@bsipocz bsipocz added this to the v0.23.0 milestone Sep 21, 2026
@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.50%. Comparing base (22afea1) to head (136b892).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
sphinx_automodapi/automodsumm.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #246   +/-   ##
=======================================
  Coverage   89.50%   89.50%           
=======================================
  Files          31       31           
  Lines        1258     1258           
=======================================
  Hits         1126     1126           
  Misses        132      132           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! It looks good, but I would do the list conversion on a different line instead.

Comment thread sphinx_automodapi/automodsumm.py Outdated
Comment thread sphinx_automodapi/automodsumm.py
Co-Authored-By: Brigitta Sipőcz <brigitta.sipocz@gmail.com>
@cthoyt

cthoyt commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

@bsipocz thanks for the feedback. The suggestions got messy so I threw out those commits and made a new one that cleans it all up

@cthoyt

cthoyt commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

Interestingly, dir() explicitly is type annotated by the standard library to return list[str], so I just took that part out.

Comment thread sphinx_automodapi/automodsumm.py Outdated
Co-authored-by: Brigitta Sipőcz <b.sipocz@gmail.com>

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@bsipocz bsipocz added the bug label Sep 21, 2026
@bsipocz
bsipocz merged commit 9f6d03e into astropy:main Sep 21, 2026
20 of 21 checks passed
@cthoyt
cthoyt deleted the patch-1 branch September 21, 2026 13:11
@pllim

pllim commented Sep 21, 2026

Copy link
Copy Markdown
Member

Thanks, all! Do we need an immediate release?

@cthoyt

cthoyt commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

I would appreciate a timely release, but not "drop everything you're doing" immediate. Cheers :)

@bsipocz

bsipocz commented Sep 21, 2026

Copy link
Copy Markdown
Member

Thanks, all! Do we need an immediate release?

There is nothing else in the diff, are we waiting for anything else? E.g. I would love to have this closed before we tag a new release: #234

@pllim

pllim commented Sep 21, 2026

Copy link
Copy Markdown
Member

I don't have time to dig into #234 . I think it is reasonable to have bugfix release with just one patch if actual users are affected?

@bsipocz

bsipocz commented Sep 21, 2026

Copy link
Copy Markdown
Member

OK, let me wait until the end of the week, maybe I'll have some time to look into this and upstream sphinx.

@pllim

pllim commented Sep 21, 2026

Copy link
Copy Markdown
Member

Thank you! 🙏 🙇‍♀️

@pllim

pllim commented Oct 5, 2026

Copy link
Copy Markdown
Member

@bsipocz , should I go ahead with the release? Please advise. Thanks!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants