Skip to content

feat(dataframe): improve DataFrame::from_columns input types (#24630) - #24633

Open
cj-zhukov wants to merge 2 commits into
apache:mainfrom
cj-zhukov:cj-zhukov/improve-dataFrame-from_columns-input-types
Open

feat(dataframe): improve DataFrame::from_columns input types (#24630)#24633
cj-zhukov wants to merge 2 commits into
apache:mainfrom
cj-zhukov:cj-zhukov/improve-dataFrame-from_columns-input-types

Conversation

@cj-zhukov

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Improve the DataFrame::from_columns API and give users more flexibility when constructing a DataFrame from columns.

What changes are included in this PR?

  • Allow DataFrame::from_columns to accept both arrays and Vecs of columns.
  • Update tests to cover both input forms.

Are these changes tested?

Yes. Tests cover both array and Vec inputs and verify the resulting schema, data types, row count, and values.

Are there any user-facing changes?

Yes. This is a non-breaking API improvement. Existing usage continues to work, while users can now choose between an array and a Vec when passing columns to DataFrame::from_columns.

@github-actions github-actions Bot added the core Core DataFusion crate label Aug 24, 2026
@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown

Thank you for opening this pull request!

Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch).

Details
     Cloning apache/main
    Building datafusion v55.0.0 (current)
       Built [  61.101s] (current)
     Parsing datafusion v55.0.0 (current)
      Parsed [   0.038s] (current)
    Building datafusion v55.0.0 (baseline)
       Built [  57.235s] (baseline)
     Parsing datafusion v55.0.0 (baseline)
      Parsed [   0.038s] (baseline)
    Checking datafusion v55.0.0 -> v55.0.0 (no change; assume patch)
     Checked [   0.880s] 223 checks: 222 pass, 1 fail, 0 warn, 31 skip

--- failure method_requires_different_generic_type_params: method now requires a different number of generic type parameters ---

Description:
A method now requires a different number of generic type parameters than it used to. Uses of this method that supplied the previous number of generic types will be broken.
        ref: https://doc.rust-lang.org/reference/items/generics.html
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/method_requires_different_generic_type_params.ron

Failed in:
  datafusion::prelude::dataframe::DataFrame::from_columns takes 2 generic types instead of 0, in /home/runner/work/datafusion/datafusion/datafusion/core/src/dataframe/mod.rs:2631
  datafusion::dataframe::DataFrame::from_columns takes 2 generic types instead of 0, in /home/runner/work/datafusion/datafusion/datafusion/core/src/dataframe/mod.rs:2631
  datafusion::prelude::DataFrame::from_columns takes 2 generic types instead of 0, in /home/runner/work/datafusion/datafusion/datafusion/core/src/dataframe/mod.rs:2631

     Summary semver requires new major version: 1 major and 0 minor checks failed
    Finished [ 121.593s] datafusion

@github-actions github-actions Bot added the auto detected api change Auto detected API change label Aug 24, 2026
@codecov-commenter

codecov-commenter commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.43%. Comparing base (26b40dd) to head (41020b6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24633      +/-   ##
==========================================
- Coverage   81.43%   81.43%   -0.01%     
==========================================
  Files        1118     1118              
  Lines      399414   399418       +4     
  Branches   399414   399418       +4     
==========================================
- Hits       325278   325272       -6     
- Misses      55145    55149       +4     
- Partials    18991    18997       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto detected api change Auto detected API change core Core DataFusion crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants