Skip to content

Conversation

MarcoGorelli
Copy link
Member

  • Closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added: Please use assert_type() to assert the type of any return value

this one's already tested

def test_insert_newvalues() -> None:
df = pd.DataFrame({"a": [1, 2]})
ab = pd.DataFrame({"col1": [1, 2], "col2": [3, 4]})
ef = pd.DataFrame({"z": [4, 5, 6]})
assert assert_type(df.insert(loc=0, column="b", value=None), None) is None
assert assert_type(ab.insert(loc=0, column="newcol", value=[99, 99]), None) is None
assert assert_type(ef.insert(loc=0, column="g", value=4), None) is None

column just wasn't typed

@MarcoGorelli MarcoGorelli marked this pull request as ready for review March 2, 2025 14:30
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MarcoGorelli

@Dr-Irv Dr-Irv merged commit b433fa6 into pandas-dev:main Mar 3, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants