Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TYP: enable reportGeneralTypeIssues but add many exceptions #44855

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:

- name: Install pyright
# note: keep version in sync with .pre-commit-config.yaml
run: npm install -g pyright@1.1.212
run: npm install -g pyright@1.1.225

- name: Build Pandas
id: build
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ repos:
types: [python]
stages: [manual]
# note: keep version in sync with .github/workflows/code-checks.yml
additional_dependencies: ['pyright@1.1.212']
additional_dependencies: ['pyright@1.1.225']
- repo: local
hooks:
- id: flake8-rst
Expand Down
1 change: 1 addition & 0 deletions pandas/_config/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
The config module holds package-wide configurables and provides
a uniform API for working with them.
Expand Down
1 change: 1 addition & 0 deletions pandas/_config/localization.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Helpers for configuring locale settings.

Expand Down
1 change: 1 addition & 0 deletions pandas/_testing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

import collections
Expand Down
1 change: 1 addition & 0 deletions pandas/_testing/_io.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

import bz2
Expand Down
1 change: 1 addition & 0 deletions pandas/_testing/asserters.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from typing import cast
Expand Down
1 change: 1 addition & 0 deletions pandas/compat/pickle_compat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Support pre-0.12 series pickle compatibility.
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
This file is very long and growing, but it was decided to not split it yet, as
it's still manageable (2020-03-17, ~1.1k LoC). See gh-31989
Expand Down
1 change: 1 addition & 0 deletions pandas/core/algorithms.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Generic data algorithms. This module is experimental at the moment and not
intended for public consumption
Expand Down
1 change: 1 addition & 0 deletions pandas/core/apply.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

import abc
Expand Down
1 change: 1 addition & 0 deletions pandas/core/array_algos/masked_reductions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
masked_reductions.py is for reduction algorithms using a mask-based approach
for missing values.
Expand Down
1 change: 1 addition & 0 deletions pandas/core/array_algos/quantile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions pandas/core/array_algos/replace.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Methods used by Block.replace and related methods.
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/array_algos/take.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

import functools
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/_mixins.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from functools import wraps
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/_ranges.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Helper functions to generate range-like data for DatetimeArray
(and possibly TimedeltaArray/PeriodArray)
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
An interface for extending pandas with custom arrays.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/boolean.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

import numbers
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from csv import QUOTE_NONNUMERIC
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/datetimelike.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from datetime import (
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from datetime import (
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/interval.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

import operator
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/masked.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from typing import (
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/numeric.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

import numbers
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/numpy_.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/period.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from datetime import timedelta
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/sparse/accessor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""Sparse accessor"""

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/sparse/array.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
SparseArray data structure
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/sparse/dtype.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""Sparse Dtype"""
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/sparse/scipy_sparse.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Interaction with scipy.sparse matrices.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/string_.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from typing import (
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/string_arrow.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from collections.abc import Callable # noqa: PDF001
Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/timedeltas.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from datetime import timedelta
Expand Down
1 change: 1 addition & 0 deletions pandas/core/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Base and utility classes for pandas objects.
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/common.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Misc tools for implementing data structures

Expand Down
1 change: 1 addition & 0 deletions pandas/core/computation/align.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Core eval alignment algorithms.
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/computation/expr.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
:func:`~pandas.eval` parsers.
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/computation/ops.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Operator classes for eval.
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/computation/pytables.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
""" manage PyTables query interface via Expressions """
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions pandas/core/construction.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Constructor functions intended to be shared by pd.array, Series.__init__,
and Index.__new__.
Expand Down
1 change: 1 addition & 0 deletions pandas/core/describe.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Module responsible for execution of NDFrame.describe() method.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/dtypes/astype.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Functions for implementing 'astype' methods according to pandas conventions,
particularly ones that differ from numpy.
Expand Down
1 change: 1 addition & 0 deletions pandas/core/dtypes/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Extend pandas with custom array types.
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/dtypes/cast.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Routines for casting.
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/dtypes/common.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Common type operations.
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/dtypes/concat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Utility functions related to concat.
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/dtypes/dtypes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Define extension dtypes.
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
DataFrame
---------
Expand Down
1 change: 1 addition & 0 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
# pyright: reportPropertyTypeMismatch=false
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions pandas/core/groupby/categorical.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Define the SeriesGroupBy and DataFrameGroupBy
classes that hold the groupby interfaces (and some implementations).
Expand Down
1 change: 1 addition & 0 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Provide the groupby split-apply-combine paradigm. Define the GroupBy
class providing the base-class of operations.
Expand Down
1 change: 1 addition & 0 deletions pandas/core/groupby/grouper.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Provide user facing operators for doing the split part of the
split-apply-combine paradigm.
Expand Down
1 change: 1 addition & 0 deletions pandas/core/groupby/ops.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Provide classes to perform the groupby aggregate operations.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexers/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Low-dependency indexing utilities.
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/accessors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
datetimelike delegation
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

import textwrap
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from datetime import datetime
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/category.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from typing import (
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/datetimelike.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Base and utility classes for tseries type pandas objects.
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/datetimes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from datetime import (
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/extension.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Shared methods for Index subclasses backed by ExtensionArray.
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/frozen.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
frozen (immutable) data structures to support MultiIndexing

Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
""" define the IntervalIndex """
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from functools import wraps
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/numeric.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from typing import (
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/period.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from datetime import (
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/range.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from datetime import timedelta
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/timedeltas.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
""" implement the TimedeltaIndex """
from __future__ import annotations

Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexing.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from contextlib import suppress
Expand Down
1 change: 1 addition & 0 deletions pandas/core/internals/api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
This is a pseudo-public API for downstream libraries. We ask that downstream
authors
Expand Down
1 change: 1 addition & 0 deletions pandas/core/internals/array_manager.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Experimental manager based on storing a collection of 1D arrays
"""
Expand Down
1 change: 1 addition & 0 deletions pandas/core/internals/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Base class for the internal managers. Both BlockManager and ArrayManager
inherit from this class.
Expand Down
1 change: 1 addition & 0 deletions pandas/core/internals/blocks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

from functools import wraps
Expand Down
1 change: 1 addition & 0 deletions pandas/core/internals/concat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

import itertools
Expand Down
1 change: 1 addition & 0 deletions pandas/core/internals/construction.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
"""
Functions for preparing various inputs passed to the DataFrame or Series
constructors before passing them to a BlockManager.
Expand Down
1 change: 1 addition & 0 deletions pandas/core/internals/managers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: reportGeneralTypeIssues = false
from __future__ import annotations

import itertools
Expand Down