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

Fix mypy errors for pandas\tests\* #28926

Closed
36 of 38 tasks
simonjayhawkins opened this issue Oct 11, 2019 · 21 comments · Fixed by #36724
Closed
36 of 38 tasks

Fix mypy errors for pandas\tests\* #28926

simonjayhawkins opened this issue Oct 11, 2019 · 21 comments · Fixed by #36724
Labels
good first issue Typing type annotations, mypy/pyright type checking

Comments

@simonjayhawkins
Copy link
Member

simonjayhawkins commented Oct 11, 2019

For a full list, expand details.

pandas\tests\tseries\offsets\test_offsets_properties.py:54: error: Argument "min_value" to "datetimes" has incompatible type "Tuple[Any]"; expected "datetime"
pandas\tests\tseries\offsets\test_offsets_properties.py:54: error: Argument "max_value" to "datetimes" has incompatible type "Tuple[Any]"; expected "datetime"
pandas\tests\io\parser\conftest.py:11: error: Need type annotation for 'float_precision_choices' (hint: "float_precision_choices: List[<type>] = ...")
pandas\tests\io\parser\conftest.py:29: error: Incompatible types in assignment (expression has type "str", base class "BaseParser" defined the type as "None")
pandas\tests\io\parser\conftest.py:42: error: Incompatible types in assignment (expression has type "str", base class "BaseParser" defined the type as "None")
pandas\tests\io\parser\conftest.py:62: error: Unsupported operand types for + ("List[CParser]" and "List[PythonParser]")
pandas\tests\extension\json\array.py:30: error: Need type annotation for 'na_value'
pandas\conftest.py:11: error: Module 'pytz' has no attribute 'FixedOffset'
pandas\conftest.py:486: error: Unsupported operand types for + ("List[str]" and "List[object]")
pandas\conftest.py:500: error: Unsupported operand types for + ("List[object]" and "List[str]")
pandas\conftest.py:505: error: Unsupported operand types for + ("List[object]" and "List[str]")
pandas\conftest.py:506: error: Unsupported operand types for + ("List[object]" and "List[str]")
pandas\tests\test_base.py:1312: error: Argument "freq" to "period_array" has incompatible type "str"; expected "Optional[Tick]"
pandas\tests\test_base.py:1354: error: Argument "freq" to "period_array" has incompatible type "str"; expected "Optional[Tick]"
pandas\tests\test_algos.py:770: error: Invalid signature "def (self: Any) -> Any"
pandas\tests\tseries\offsets\test_offsets.py:662: error: Incompatible types in assignment (expression has type "Type[BusinessDay]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_offsets.py:757: error: Argument 1 to "append" of "list" has incompatible type "Tuple[int, Dict[datetime, datetime]]"; expected "Tuple[BusinessDay, Dict[datetime, datetime]]"
pandas\tests\tseries\offsets\test_offsets.py:784: error: Argument 1 to "append" of "list" has incompatible type "Tuple[int, Dict[datetime, datetime]]"; expected "Tuple[BusinessDay, Dict[datetime, datetime]]"
pandas\tests\tseries\offsets\test_offsets.py:849: error: Incompatible types in assignment (expression has type "Type[BusinessHour]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_offsets.py:2255: error: Incompatible types in assignment (expression has type "Type[CustomBusinessHour]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_offsets.py:2547: error: Incompatible types in assignment (expression has type "Type[CustomBusinessDay]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_offsets.py:2645: error: Argument 1 to "append" of "list" has incompatible type "Tuple[int, Dict[datetime, datetime]]"; expected "Tuple[CustomBusinessDay, Dict[datetime, datetime]]"
pandas\tests\tseries\offsets\test_offsets.py:2672: error: Argument 1 to "append" of "list" has incompatible type "Tuple[int, Dict[datetime, datetime]]"; expected "Tuple[CustomBusinessDay, Dict[datetime, datetime]]"
pandas\tests\tseries\offsets\test_offsets.py:2826: error: Incompatible types in assignment (expression has type "Type[CustomBusinessMonthEnd]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_offsets.py:2889: error: Argument 1 to "append" of "list" has incompatible type "Tuple[int, Dict[datetime, datetime]]"; expected "Tuple[CustomBusinessMonthEnd, Dict[datetime, datetime]]"
pandas\tests\tseries\offsets\test_offsets.py:2909: error: Argument 1 to "append" of "list" has incompatible type "Tuple[int, Dict[datetime, datetime]]"; expected "Tuple[CustomBusinessMonthEnd, Dict[datetime, datetime]]"
pandas\tests\tseries\offsets\test_offsets.py:2975: error: Incompatible types in assignment (expression has type "Type[CustomBusinessMonthBegin]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_offsets.py:3038: error: Argument 1 to "append" of "list" has incompatible type "Tuple[int, Dict[datetime, datetime]]"; expected "Tuple[CustomBusinessMonthBegin, Dict[datetime, datetime]]"
pandas\tests\tseries\offsets\test_offsets.py:3058: error: Argument 1 to "append" of "list" has incompatible type "Tuple[int, Dict[datetime, datetime]]"; expected "Tuple[CustomBusinessMonthBegin, Dict[datetime, datetime]]"
pandas\tests\tseries\offsets\test_offsets.py:3123: error: Incompatible types in assignment (expression has type "Type[Week]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_offsets.py:3125: error: Cannot determine type of '_offset'
pandas\tests\tseries\offsets\test_offsets.py:3126: error: Cannot determine type of '_offset'
pandas\tests\tseries\offsets\test_offsets.py:3222: error: Incompatible types in assignment (expression has type "Type[WeekOfMonth]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_offsets.py:3223: error: Cannot determine type of '_offset'
pandas\tests\tseries\offsets\test_offsets.py:3224: error: Cannot determine type of '_offset'
pandas\tests\tseries\offsets\test_offsets.py:3322: error: Incompatible types in assignment (expression has type "Type[LastWeekOfMonth]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_offsets.py:3323: error: Cannot determine type of '_offset'
pandas\tests\tseries\offsets\test_offsets.py:3324: error: Cannot determine type of '_offset'
pandas\tests\tseries\offsets\test_offsets.py:3399: error: Incompatible types in assignment (expression has type "Type[SemiMonthEnd]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_offsets.py:3400: error: Cannot determine type of '_offset'
pandas\tests\tseries\offsets\test_offsets.py:3401: error: Cannot determine type of '_offset'
pandas\tests\tseries\offsets\test_offsets.py:3658: error: Incompatible types in assignment (expression has type "Type[SemiMonthBegin]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_offsets.py:3659: error: Cannot determine type of '_offset'
pandas\tests\tseries\offsets\test_offsets.py:3660: error: Cannot determine type of '_offset'
pandas\tests\series\test_constructors.py:48: error: Need type annotation for 'x'
pandas\tests\series\test_constructors.py:53: error: Need type annotation for 'x'
pandas\tests\plotting\test_backend.py:12: error: Module has no attribute "plot"
pandas\tests\io\test_sql.py:964: error: Incompatible types in assignment (expression has type "str", base class "_TestSQLApi" defined the type as "None")
pandas\tests\io\test_sql.py:1156: error: Incompatible types in assignment (expression has type "str", base class "_TestSQLApi" defined the type as "None")
pandas\tests\io\test_sql.py:2075: error: Definition of "flavor" in base class "_TestMySQLAlchemy" is incompatible with definition in base class "_TestSQLAlchemy"
pandas\tests\io\test_sql.py:2081: error: Definition of "flavor" in base class "_TestMySQLAlchemy" is incompatible with definition in base class "_TestSQLAlchemy"
pandas\tests\io\test_sql.py:2087: error: Definition of "flavor" in base class "_TestPostgreSQLAlchemy" is incompatible with definition in base class "_TestSQLAlchemy"
pandas\tests\io\test_sql.py:2093: error: Definition of "flavor" in base class "_TestPostgreSQLAlchemy" is incompatible with definition in base class "_TestSQLAlchemy"
pandas\tests\io\test_sql.py:2098: error: Definition of "flavor" in base class "_TestSQLiteAlchemy" is incompatible with definition in base class "_TestSQLAlchemy"
pandas\tests\io\test_sql.py:2103: error: Definition of "flavor" in base class "_TestSQLiteAlchemy" is incompatible with definition in base class "_TestSQLAlchemy"
pandas\tests\io\json\test_ujson.py:4: error: Name 'json' already defined (by an import)
pandas\tests\indexing\test_coercion.py:933: error: List item 0 has incompatible type "int"; expected "str"
pandas\tests\indexing\test_coercion.py:933: error: List item 1 has incompatible type "int"; expected "str"
pandas\tests\indexing\test_coercion.py:934: error: List item 0 has incompatible type "float"; expected "str"
pandas\tests\indexing\test_coercion.py:934: error: List item 1 has incompatible type "float"; expected "str"
pandas\tests\indexing\test_coercion.py:935: error: List item 0 has incompatible type "complex"; expected "str"
pandas\tests\indexing\test_coercion.py:935: error: List item 1 has incompatible type "complex"; expected "str"
pandas\tests\indexing\test_coercion.py:936: error: List item 0 has incompatible type "bool"; expected "str"
pandas\tests\indexing\test_coercion.py:936: error: List item 1 has incompatible type "bool"; expected "str"
pandas\tests\indexes\interval\test_interval_tree.py:157: error: Argument 1 to "map" has incompatible type "Type[List[Any]]"; expected "Callable[[Tuple[int, ...]], List[_T]]"
pandas\tests\indexes\interval\test_interval_tree.py:164: error: Argument 1 to "map" has incompatible type "Type[List[Any]]"; expected "Callable[[Tuple[int, ...]], List[_T]]"
pandas\tests\frame\test_constructors.py:53: error: Need type annotation for 'x'
pandas\tests\frame\test_constructors.py:59: error: Need type annotation for 'x'
pandas\tests\frame\test_constructors.py:75: error: Need type annotation for 'x'
pandas\tests\dtypes\test_inference.py:78: error: Need type annotation for 'x'
pandas\tests\dtypes\test_inference.py:291: error: Too many arguments for "tuple"
pandas\tests\dtypes\test_inference.py:291: error: Argument 1 to "tuple" has incompatible type "int"; expected "Iterable[Any]"
pandas\tests\computation\test_eval.py:1883: error: Dict entry 1 has incompatible type "str": "Type[ExprVisitor]"; expected "str": "Type[BaseExprVisitor]"
pandas\tests\arrays\test_period.py:245: error: Argument "freq" to "period_array" has incompatible type "str"; expected "Optional[Tick]"
pandas\tests\arrays\test_datetimelike.py:225: error: Incompatible types in assignment (expression has type "Type[DatetimeIndex]", base class "SharedTests" defined the type as "None")
pandas\tests\arrays\test_datetimelike.py:476: error: Incompatible types in assignment (expression has type "Type[TimedeltaIndex]", base class "SharedTests" defined the type as "None")
pandas\tests\arrays\test_datetimelike.py:586: error: Incompatible types in assignment (expression has type "Type[PeriodIndex]", base class "SharedTests" defined the type as "None")
pandas\tests\arithmetic\test_datetime64.py:2164: error: "DatetimeIndex" has no attribute "tz_localize"
pandas\tests\tseries\offsets\test_yqm_offsets.py:545: error: Incompatible types in assignment (expression has type "Type[QuarterEnd]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_yqm_offsets.py:692: error: Incompatible types in assignment (expression has type "Type[BQuarterBegin]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_yqm_offsets.py:817: error: Incompatible types in assignment (expression has type "Type[BQuarterEnd]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_yqm_offsets.py:964: error: Incompatible types in assignment (expression has type "Type[YearBegin]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_yqm_offsets.py:1118: error: Incompatible types in assignment (expression has type "Type[YearEnd]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_yqm_offsets.py:1267: error: Incompatible types in assignment (expression has type "Type[BYearBegin]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_yqm_offsets.py:1340: error: Incompatible types in assignment (expression has type "Type[BYearEnd]", base class "Base" defined the type as "None")
pandas\tests\tseries\offsets\test_yqm_offsets.py:1413: error: Incompatible types in assignment (expression has type "Type[BYearEnd]", base class "Base" defined the type as "None")
pandas\tests\series\test_operators.py:787: error: "Type[Series]" has no attribute "div"
pandas\tests\series\test_operators.py:787: error: "Type[Series]" has no attribute "rdiv"
pandas\tests\indexing\test_loc.py:819: error: No overload variant of "slice" matches argument types "None", "str", "None"
pandas\tests\indexing\test_loc.py:819: note: Possible overload variant:
pandas\tests\indexing\test_loc.py:819: note:     def __init__(self, start: Optional[int], stop: Optional[int], step: Optional[int] = ...) -> slice
pandas\tests\indexing\test_loc.py:819: note:     <1 more non-matching overload not shown>
pandas\tests\indexes\test_numeric.py:99: error: Incompatible types in assignment (expression has type "Type[Float64Index]", base class "Base" defined the type as "None")
pandas\tests\indexes\test_numeric.py:605: error: Incompatible types in assignment (expression has type "Type[Int64Index]", base class "Base" defined the type as "None")
pandas\tests\indexes\test_numeric.py:889: error: Incompatible types in assignment (expression has type "Type[UInt64Index]", base class "Base" defined the type as "None")
pandas\tests\indexes\test_category.py:20: error: Incompatible types in assignment (expression has type "Type[CategoricalIndex]", base class "Base" defined the type as "None")
pandas\tests\indexes\test_base.py:49: error: Incompatible types in assignment (expression has type "Type[Index]", base class "Base" defined the type as "None")
pandas\tests\indexes\test_base.py:526: error: Need type annotation for 'x'
pandas\tests\indexes\test_base.py:549: error: Need type annotation for 'x'
pandas\tests\indexes\test_base.py:1743: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:1744: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:1745: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:1746: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:1747: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:1748: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:1750: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:1751: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:1752: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:1753: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:1754: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:1755: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:1756: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:1757: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:1758: error: Slice index must be an integer or None
pandas\tests\indexes\test_base.py:2438: error: Incompatible types in assignment (expression has type "Type[Index]", base class "Base" defined the type as "None")
pandas\tests\indexes\interval\test_base.py:15: error: Incompatible types in assignment (expression has type "Type[IntervalIndex]", base class "Base" defined the type as "None")
pandas\tests\frame\test_convert_to.py:579: error: Argument 1 to "defaultdict" has incompatible type "Type[List[Any]]"; expected "Optional[Callable[[], Dict[str, float]]]"
pandas\tests\dtypes\test_common.py:327: error: Unsupported operand types for + ("List[Series]" and "List[str]")
pandas\tests\dtypes\test_common.py:355: error: Unsupported operand types for + ("List[Series]" and "List[object]")
pandas\tests\dtypes\test_common.py:387: error: Unsupported operand types for + ("List[Series]" and "List[str]")
pandas\tests\api\test_api.py:44: error: Need type annotation for 'deprecated_modules' (hint: "deprecated_modules: List[<type>] = ...")
pandas\tests\api\test_api.py:95: error: Need type annotation for 'deprecated_classes' (hint: "deprecated_classes: List[<type>] = ...")
pandas\tests\api\test_api.py:98: error: Need type annotation for 'deprecated_classes_in_future' (hint: "deprecated_classes_in_future: List[<type>] = ...")
pandas\tests\api\test_api.py:174: error: Need type annotation for 'deprecated_funcs_in_future' (hint: "deprecated_funcs_in_future: List[<type>] = ...")
pandas\tests\api\test_api.py:177: error: Need type annotation for 'deprecated_funcs' (hint: "deprecated_funcs: List[<type>] = ...")
pandas\tests\indexes\test_range.py:22: error: Incompatible types in assignment (expression has type "Type[RangeIndex]", base class "Base" defined the type as "None")
pandas\tests\indexes\timedeltas\test_timedelta.py:31: error: Incompatible types in assignment (expression has type "Type[TimedeltaIndex]", base class "Base" defined the type as "None")
pandas\tests\indexes\period\test_period.py:26: error: Incompatible types in assignment (expression has type "Type[PeriodIndex]", base class "Base" defined the type as "None")
pandas\tests\indexes\datetimes\test_datetimelike.py:10: error: Incompatible types in assignment (expression has type "Type[DatetimeIndex]", base class "Base" defined the type as "None")
pandas\tests\arrays\test_array.py:36: error: Argument "freq" to "period_array" has incompatible type "str"; expected "Optional[Tick]"
pandas\tests\arrays\test_array.py:42: error: Argument "freq" to "period_array" has incompatible type "str"; expected "Optional[Tick]"
pandas\tests\arrays\test_array.py:128: error: Argument "freq" to "period_array" has incompatible type "str"; expected "Optional[Tick]"
pandas\tests\arrays\test_array.py:163: error: Argument "freq" to "period_array" has incompatible type "str"; expected "Optional[Tick]"
pandas\tests\extension\test_sparse.py:311: error: Incompatible types in assignment (expression has type "None", base class "BaseArithmeticOpsTests" defined the type as "Type[TypeError]")
pandas\tests\extension\test_sparse.py:312: error: Incompatible types in assignment (expression has type "None", base class "BaseArithmeticOpsTests" defined the type as "Type[TypeError]")
pandas\tests\extension\test_sparse.py:313: error: Incompatible types in assignment (expression has type "None", base class "BaseArithmeticOpsTests" defined the type as "Type[TypeError]")
pandas\tests\extension\test_sparse.py:314: error: Incompatible types in assignment (expression has type "None", base class "BaseArithmeticOpsTests" defined the type as "Type[TypeError]")
pandas\tests\extension\test_numpy.py:252: error: Incompatible types in assignment (expression has type "None", base class "BaseArithmeticOpsTests" defined the type as "Type[TypeError]")
pandas\tests\extension\test_numpy.py:253: error: Incompatible types in assignment (expression has type "None", base class "BaseArithmeticOpsTests" defined the type as "Type[TypeError]")
pandas\tests\extension\test_numpy.py:254: error: Incompatible types in assignment (expression has type "None", base class "BaseArithmeticOpsTests" defined the type as "Type[TypeError]")
pandas\tests\extension\test_numpy.py:255: error: Incompatible types in assignment (expression has type "None", base class "BaseArithmeticOpsTests" defined the type as "Type[TypeError]")
pandas\tests\extension\json\test_json.py:118: error: Definition of "assert_series_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:118: error: Definition of "assert_frame_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:122: error: Definition of "assert_series_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:122: error: Definition of "assert_frame_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:145: error: Definition of "assert_series_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:145: error: Definition of "assert_frame_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:152: error: Definition of "assert_series_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:152: error: Definition of "assert_frame_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:168: error: Definition of "assert_series_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:168: error: Definition of "assert_frame_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:172: error: Definition of "assert_series_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:172: error: Definition of "assert_frame_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:192: error: Definition of "assert_series_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:192: error: Definition of "assert_frame_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:248: error: Definition of "assert_series_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:248: error: Definition of "assert_frame_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:261: error: Definition of "assert_series_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:261: error: Definition of "assert_frame_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:289: error: Definition of "assert_series_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:289: error: Definition of "assert_frame_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:307: error: Definition of "assert_series_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:307: error: Definition of "assert_frame_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:311: error: Definition of "assert_series_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\json\test_json.py:311: error: Definition of "assert_frame_equal" in base class "BaseJSON" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:113: error: Definition of "assert_series_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:113: error: Definition of "assert_frame_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:118: error: Definition of "assert_series_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:118: error: Definition of "assert_frame_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:122: error: Definition of "assert_series_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:122: error: Definition of "assert_frame_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:129: error: Definition of "assert_series_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:129: error: Definition of "assert_frame_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:133: error: Definition of "assert_series_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:133: error: Definition of "assert_frame_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:141: error: Definition of "assert_series_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:141: error: Definition of "assert_frame_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:166: error: Definition of "assert_series_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:166: error: Definition of "assert_frame_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:182: error: Definition of "assert_series_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:182: error: Definition of "assert_frame_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:186: error: Definition of "assert_series_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:186: error: Definition of "assert_frame_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:194: error: Definition of "assert_series_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:194: error: Definition of "assert_frame_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:198: error: Definition of "assert_series_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:198: error: Definition of "assert_frame_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:267: error: Definition of "assert_series_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:267: error: Definition of "assert_frame_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:301: error: Definition of "assert_series_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
pandas\tests\extension\decimal\test_decimal.py:301: error: Definition of "assert_frame_equal" in base class "BaseDecimal" is incompatible with definition in base class "BaseExtensionTests"
(pandas-dev) 

This breaks down to the following number of errors in relevant modules:

assume that the degree of difficulty to resolve will vary, but some should be good first issues.

PRs to tackle individual modules preferred and remove from whitelist in setup.cfg.

@simonjayhawkins simonjayhawkins added good first issue Typing type annotations, mypy/pyright type checking labels Oct 11, 2019
@simonjayhawkins simonjayhawkins added this to the Contributions Welcome milestone Oct 11, 2019
@angelaambroz
Copy link
Contributor

✋ I'd like to work on this! I can take the mypy errors in pandas\conftest.py.

@yogendrasoni
Copy link
Contributor

I would like to work on \api\test_api.py.

@lukasbk
Copy link
Contributor

lukasbk commented Oct 12, 2019

I would like to work on \extension\test_numpy.py to get started. Will be my first pull request.

@yogendrasoni
Copy link
Contributor

yogendrasoni commented Oct 13, 2019

working on
pandas\tests\arrays\test_array.py

for this i changed pandas/core/arrays/period.py
freq: Optional[Tick] => freq: Optional[Union[str, Tick]] .
Is this correct approach to resolve this.
Also one more option "offset" is possible.Test cases are not using offset object in freq so Union[str, Tick] is not giving any mypy issue.

@aaditya-panik
Copy link
Contributor

aaditya-panik commented Oct 14, 2019

First time contributing 👶
having a look at:

  • /pandas/tests/tseries/test_offsets_properties.py
  • /pandas/tests/io/parser/conftest.py
  • /pandas/tests/io/test_sql.py
  • /pandas/tests/extension/json/array.py

@adamkusmirek
Copy link

adamkusmirek commented Oct 14, 2019

Having a look at

  • pandas\tests\dtypes\test_inference.py
    line291: The Problem here is due to mypy not being able to correctly infer types when unpacking the values tuple.
    A fix would be to use the defaults keyword to fill in default values with the Problem that this was introduced in python 3.7 (so not backwards compatible)
    Another fix would be to use typing.NamedTuple which bars using the pytest.mark.parametrize annotation since one cannot instantiate the NamedTuple inline because this would result in a new mypy error: NamedTuple not callable.

    So really, this is just due to a current limitation of mypy.
    For the sake of backwards compatibility, maybe the most straightforward fix would be to just #type: ignore or remove the mark.parametrize on that test and provide the test object in a different manner.
    Any thoughts on what is better?

@lukasbk
Copy link
Contributor

lukasbk commented Oct 15, 2019

I'll work on indexing\test_coercion.py.

@lukasbk
Copy link
Contributor

lukasbk commented Oct 15, 2019

Now looking into

  • extension\json\test_json.py
  • tseries\offsets\test_yqm_offsets.py

proost pushed a commit to proost/pandas that referenced this issue Dec 19, 2019
…28935)

*  fix pandas-dev#28926 pandas\api\test_api.py mypy errors

*  fix pandas-dev#28926 pandas\api\test_api.py mypy errors

*  changed to  type comment to support v 3.5

* removed section mypy-pandas.tests.api.test_api

* fix annotation and revert delete

* fix import sorting

* fix import sorting
proost pushed a commit to proost/pandas that referenced this issue Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this issue Dec 19, 2019
bongolegend pushed a commit to bongolegend/pandas that referenced this issue Jan 1, 2020
…28935)

*  fix pandas-dev#28926 pandas\api\test_api.py mypy errors

*  fix pandas-dev#28926 pandas\api\test_api.py mypy errors

*  changed to  type comment to support v 3.5

* removed section mypy-pandas.tests.api.test_api

* fix annotation and revert delete

* fix import sorting

* fix import sorting
bongolegend pushed a commit to bongolegend/pandas that referenced this issue Jan 1, 2020
bongolegend pushed a commit to bongolegend/pandas that referenced this issue Jan 1, 2020
@SaturnFromTitan
Copy link
Contributor

take

@SaturnFromTitan
Copy link
Contributor

I will take care of the issues where the stale PRs were closed:

  • pandas\tests\extension\decimal\test_decimal.py
  • pandas\tests\extension\json\array.py
  • pandas\tests\arithmetic\test_datetime64.py

@Sounakde
Copy link

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging a pull request may close this issue.