Skip to content

Accept callable progress factories in tqdm.dask - #16939

Open
Lushiyao5 wants to merge 1 commit into
python:mainfrom
Lushiyao5:fix-tqdm-dask-factory-types
Open

Lushiyao5 wants to merge 1 commit into
python:mainfrom
Lushiyao5:fix-tqdm-dask-factory-types

Conversation

@Lushiyao5

Copy link
Copy Markdown
Contributor

TqdmCallback invokes the supplied tqdm_class as a factory with a total keyword argument. It wraps that factory in functools.partial when given additional progress-bar options. Use a callable type for both the parameter and the stored attribute so classes, functions, and partials are accepted.

I verified a Dask task using a function factory and checked that the attribute holds a partial when options are supplied. The same example showed both typing mismatches before the change and passed mypy with the updated stub. The stub also passed mypy.

This patch was prepared with assistance from OpenAI Codex.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

This branch has not been deployed

No deployments
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.

1 participant