Skip to content

DOC: Imprecision in the type description of pd.concat parameter #56845

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

Closed
1 task done
kodimatrix opened this issue Jan 12, 2024 · 3 comments · Fixed by #56909
Closed
1 task done

DOC: Imprecision in the type description of pd.concat parameter #56845

kodimatrix opened this issue Jan 12, 2024 · 3 comments · Fixed by #56909
Assignees
Labels
Docs Reshaping Concat, Merge/Join, Stack/Unstack, Explode

Comments

@kodimatrix
Copy link
Contributor

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/reference/api/pandas.concat.html

Documentation problem

The pd.concat() function has a parameter obj with the typing hint:: Iterable (and other). It is possible to call this function with a generator, for example. However, the documentation refers to it as "a sequence...". According to the glossary (and collections.abs module, respectively), this is a small imprecision.

https://docs.python.org/3/glossary.html#term-iterable
https://docs.python.org/3/glossary.html#term-sequence

Suggested fix for documentation

Replace "sequence" with "iterable".

@kodimatrix kodimatrix added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Jan 12, 2024
@rhshadrach
Copy link
Member

We convert any non-mapping argument to a list

objs = list(objs)

I'd be okay with refining the documentation here but want to make sure we're okay explicitly supporting generators. cc @mroeschke @phofl

@rhshadrach rhshadrach added Reshaping Concat, Merge/Join, Stack/Unstack, Explode Needs Discussion Requires discussion from core team before further action and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Jan 14, 2024
@mroeschke
Copy link
Member

Yeah generally any constructor should accept generators.

@rhshadrach rhshadrach removed the Needs Discussion Requires discussion from core team before further action label Jan 15, 2024
@kodimatrix
Copy link
Contributor Author

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants