You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✗ tox -re static-charm
static-charm: remove tox env folder /home/jose/trabajos/canonical/repos/cos-proxy-operator/.tox/static-charm
static-charm: install_deps> python -I -m pip install httpcore==0.14.7 pyright==1.1.381 responses==0.20.0 -r /home/jose/trabajos/canonical/repos/cos-proxy-operator/requirements.txt
static-charm: commands[0]> pyright /home/jose/trabajos/canonical/repos/cos-proxy-operator/src
WARNING: there is a new pyright version available (v1.1.381 -> v1.1.389).
Please install the new version or set PYRIGHT_PYTHON_FORCE_VERSION to `latest`
0 errors, 0 warnings, 0 informations
static-charm: OK (60.07=setup[43.68]+cmd[16.39] seconds)
congratulations :) (60.61 seconds)
But with 1.1.382+ I see these errors:
✗ tox -e static-charm
static-charm: commands[0]> pyright /home/jose/trabajos/canonical/repos/cos-proxy-operator/src
WARNING: there is a new pyright version available (v1.1.382 -> v1.1.389).
Please install the new version or set PYRIGHT_PYTHON_FORCE_VERSION to `latest`
/home/jose/trabajos/canonical/repos/cos-proxy-operator/src/charm.py
/home/jose/trabajos/canonical/repos/cos-proxy-operator/src/charm.py:309:37 - error: Argument missing for parameter "static_configs" (reportCallIssue)
/home/jose/trabajos/canonical/repos/cos-proxy-operator/src/charm.py:309:54 - error: Argument expression after ** must be a mapping with a "str" key type (reportCallIssue)
/home/jose/trabajos/canonical/repos/cos-proxy-operator/src/charm.py:330:38 - error: Arguments missing for parameters "name", "rules" (reportCallIssue)
/home/jose/trabajos/canonical/repos/cos-proxy-operator/src/charm.py:330:56 - error: Argument expression after ** must be a mapping with a "str" key type (reportCallIssue)
/home/jose/trabajos/canonical/repos/cos-proxy-operator/src/charm.py:639:64 - error: Argument of type"str | list[Unknown] | dict[Any, Any] | Unknown | Any" cannot be assigned to parameter "job_name" of type"str"infunction"remove_prometheus_jobs"
Type "str | list[Unknown] | dict[Any, Any] | Unknown | Any" is not assignable to type"str""dict[Any, Any]" is not assignable to "str" (reportArgumentType)
/home/jose/trabajos/canonical/repos/cos-proxy-operator/src/charm.py:664:35 - error: No overloads for"__getitem__" match the provided arguments (reportCallIssue)
/home/jose/trabajos/canonical/repos/cos-proxy-operator/src/charm.py:664:35 - error: Argument of type"Literal['labels']" cannot be assigned to parameter "s" of type"slice"infunction"__getitem__""Literal['labels']" is not assignable to "slice" (reportArgumentType)
/home/jose/trabajos/canonical/repos/cos-proxy-operator/src/charm.py:665:17 - error: Argument of type"Dict[str, Any] | list[Unknown] | dict[Any, Any] | Unknown | Any" cannot be assigned to parameter "unit_rules" of type"dict[Unknown, Unknown]"infunction"set_alert_rule_data"
Type "Dict[str, Any] | list[Unknown] | dict[Any, Any] | Unknown | Any" is not assignable to type"dict[Unknown, Unknown]""list[Unknown]" is not assignable to "dict[Unknown, Unknown]" (reportArgumentType)
8 errors, 0 warnings, 0 informations
static-charm: exit 1 (15.58 seconds) /home/jose/trabajos/canonical/repos/cos-proxy-operator> pyright /home/jose/trabajos/canonical/repos/cos-proxy-operator/src pid=719891
static-charm: FAIL code 1 (15.73=setup[0.15]+cmd[15.58] seconds)
evaluation failed :( (16.31 seconds)
Enhancement Proposal
This issue was found while working in this PR: #163
It was already opened in microsoft/pyright#9539
They say this is unlikely to be a bug in
pyright
However, until version 1.1.381 everything was OK:
But with
1.1.382
+ I see these errors:Context
For the first 2 errors (line 309)
job_data
is a dictionary generated by the method_static_scrape_job
that has thestatic_configs
key:The
ScrapeJobModel
class is pydanticBaseModel
that looks like:The text was updated successfully, but these errors were encountered: