posit-dev / posit-dev/py-shiny

Type check fails with recent versions of pyright

Open
#609 1 comment 0 reactions 1 assignee View on GitHub

@schloerke is already working on this.

Since Jul 10, 2023.

Dominant language
Python
Stars
1.8k
Forks
135
Avg merge
2d 18h
Merged PRs (30d)
21

Description

Starting with pyright 1.1.313 (I think), we've started getting errors like this:

  /Users/winston/Projects/py-shiny/shiny/ui/_bootstrap.py:76:43 - error: Argument of type "TagAttrValue" cannot be assigned to parameter "_add_ws" of type "bool" in function "div"
    Type "TagAttrValue" cannot be assigned to type "bool"
      "float" is incompatible with "bool" (reportGeneralTypeIssues)

https://github.com/rstudio/py-shiny/blob/f29d8a20166e4e1545170d35ef05c80385136802/shiny/ui/_bootstrap.py#L47-L76

The problem is that the **kwargs have type TagAttrValue, but when it passes them along to div(), they may encompass the _add_ws parameter, which has type bool.

Some potentially useful references:

Contributor guide

No contributing guide indexed for this repository

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.