Skip to content

type dataframe.insert #1137

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

Merged
merged 1 commit into from
Mar 3, 2025
Merged

type dataframe.insert #1137

merged 1 commit into from
Mar 3, 2025

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