Skip to content

Create dataframes from Python objects (pandas, polars, dictionary, list, pyarrow Table) #241

@simicd

Description

@simicd

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
With PR #235 & #197 datafusion DataFrames can be directly converted to Python list, Python dictionary, pandas, polars or Arrow Table. I'd like to have the functionality to go the other way and create datafusion DataFrames from these object types, e.g. from a dictionary:

import datafusion

ctx = datafusion.SessionContext()
df = ctx.from_pydict({"a": [1, 2, 3], "b": [4, 5, 6]})
# Dataframe:
# +---+---+
# | a | b |
# +---+---+
# | 1 | 4 |
# | 2 | 5 |
# | 3 | 6 |
# +---+---+

Describe the solution you'd like
Context methods that can generate datafusion DataFrames using pyarrow's from_... methods (e.g. from_pandas, from_pydict, ...)

  • from_pydict
  • from_pylist
  • from_pandas
  • from_polars
  • from_arrow_table

Describe alternatives you've considered
n/a

Additional context
n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions