Skip to content

API: io functions for v2 #2116

@MarcoGorelli

Description

@MarcoGorelli

Currently we're a bit inconsistent with IO functions:

  • from_native
  • from_dict
  • from_arrow
  • new_series
  • from_numpy

I think we might be better off movings towards:

  • from_native: may return Series, DataFrame, or LazyFrame, depending on the input. This one stays
  • DataFrame.from_native: like from_native(..., eager_only=True, allow_series=False)
  • LazyFrame.from_native: like from_native(...).lazy()
  • Series.from_native: like from_native(..., series_only=True)
  • DataFrame.from_dict, DataFrame.from_arrow, DataFrame.from_numpy. Remove the top-level ones
  • Series.from_iterable, Series.from_numpy. Remove nw.new_series, that's an inconsistent name

All of this would only affect the main namespace and stable.v2 onwards, stable.v1 should remain unaffected

PRs

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    api designenhancementNew feature or requesthigh priorityYour PR will be reviewed very quickly if you address this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions