Skip to content

Fix bug that causes Merge to fail with empty DataFrames#7573

Merged
tarekgh merged 2 commits intodotnet:mainfrom
sevenzees:main
Feb 5, 2026
Merged

Fix bug that causes Merge to fail with empty DataFrames#7573
tarekgh merged 2 commits intodotnet:mainfrom
sevenzees:main

Conversation

@sevenzees
Copy link
Contributor

Fixes #7572

When using the DataFrame Merge method, if one of the DataFrames is empty (has no rows), you will get a System.ArgumentOutOfRangeException. This was caused by the Clone method trying to access the first element of the empty Buffers array. It is easily fixed by returning an empty container of the appropriate length when Buffers.Count == 0.

@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.07%. Comparing base (25b977e) to head (17caca4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7573      +/-   ##
==========================================
+ Coverage   69.02%   69.07%   +0.04%     
==========================================
  Files        1482     1483       +1     
  Lines      274099   274362     +263     
  Branches    28266    28270       +4     
==========================================
+ Hits       189199   189503     +304     
+ Misses      77518    77478      -40     
+ Partials     7382     7381       -1     
Flag Coverage Δ
Debug 69.07% <100.00%> (+0.04%) ⬆️
production 63.33% <100.00%> (+0.01%) ⬆️
test 89.51% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...icrosoft.Data.Analysis/PrimitiveColumnContainer.cs 86.58% <100.00%> (+0.06%) ⬆️
...t/Microsoft.Data.Analysis.Tests/DataFrameAssert.cs 100.00% <100.00%> (ø)
...rosoft.Data.Analysis.Tests/DataFrameTests.Merge.cs 99.09% <100.00%> (+0.50%) ⬆️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sevenzees
Copy link
Contributor Author

Looks like some builds timed out, which doesn't appear to be related to my commit. Is there some way to run them again?

@sevenzees
Copy link
Contributor Author

@tarekgh I see that you have been active in this repo recently. Are you able to review this PR or point me to someone who can?

@tarekgh
Copy link
Member

tarekgh commented Feb 4, 2026

Thanks @sevenzees!

@ericstj the change LGTM. Please let me know if you have any feedback or we are good to merge. Thanks!

CC @jeffhandley

Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @rokonec @ManickaP -- it looks like Mac CI is timing out. Might be something to look into -- seems like the helix jobs are sitting in queue and not running.

@tarekgh tarekgh merged commit 3604580 into dotnet:main Feb 5, 2026
21 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataFrame Merge method throws exception when one of the DataFrames is empty.

3 participants