Skip to content

Conversation

cmp0xff
Copy link
Contributor

@cmp0xff cmp0xff commented Jun 23, 2025

Describe the bug

Following #1250, DataFrame.assign() should allow Sequences, e.g. tuples

To Reproduce

import pandas as pd
df = pd.DataFrame({"a": (1,2,3)})
df = df.assign(d=lambda df: (10,20,30))

Need to update IntoColumn in _typing.pyi to include Sequence[Scalar]

Please complete the following information

  • OS: Windows 11

  • python version: 3.10

  • mypy 1.16.0

  • version of installed pandas-stubs : development version

  • Tests added: Please use assert_type() to assert the type of any return value

@cmp0xff cmp0xff force-pushed the hotfix/cmp0xff/assign-empty-and-tuple branch from c214cf0 to c8d241a Compare June 23, 2025 13:28
@cmp0xff cmp0xff changed the title fix: assign empty and tuple fix: assign and tuple Jun 23, 2025
@cmp0xff cmp0xff changed the title fix: assign and tuple fix: assign Sequences Jun 23, 2025
@cmp0xff cmp0xff marked this pull request as ready for review June 23, 2025 13:37
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 @cmp0xff

@Dr-Irv Dr-Irv merged commit 494b3b0 into pandas-dev:main Jun 23, 2025
13 checks passed
@cmp0xff cmp0xff deleted the hotfix/cmp0xff/assign-empty-and-tuple branch July 11, 2025 12:48
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