Skip to content

Implement __matmul__, typehint pd.DataFrame.eval inplace and test conversion for test_frame.py #1053

Closed
@loicdiridollou

Description

@loicdiridollou

Describe the bug

  • @ operator on dataframe is not typehinted properly.
  • df.eval("...", inplace=True) returns Unknown
  • Convert test for types into check/assert_type framework

To Reproduce

import pandas as pd

df1 = pd.DataFrame([[0, 1, -2, -1], [1, 1, 1, 1]])
df2 = pd.DataFrame([[0, 1], [1, 2], [-1, -1], [2, 0]])

check(assert_type(df1 @ df2, pd.DataFrame ),pd.DataFrame )
check(assert_type(df1.eval("c = 0 + 1", inplace=True), None), type(None))

Please complete the following information:

  • OS: [e.g. Windows, Linux, MacOS] MacOS
  • OS Version [e.g. 22] 15
  • python version 3.12
  • version of type checker 1.13
  • version of installed pandas-stubs 2.2.3.20241009

Metadata

Metadata

Labels

Numeric OperationsArithmetic, Comparison, and Logical operationsinplaceRelating to inplace parameter or equivalent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions