Skip to content
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

Accessing data by column after adding columns to a DataFrame returns error data #7136

Merged
merged 1 commit into from
May 29, 2024

Conversation

feiyun0112
Copy link
Contributor

@feiyun0112 feiyun0112 commented Apr 22, 2024

fix #7135

Describe the bug
Accessing data by column after adding columns to a DataFrame returns error data

var df = DataFrame.LoadCsvFromString("a1,a2\n1,2\n3,4");
var dc0 = DataFrameColumn.Create("a0", new int[] { 0, 0 });
df.Columns.Insert(0, dc0);
var dc1 = df["a1"];
Console.WriteLine(dc1.ToString());

This code expected print: a1: 1 3
But it print: a0: 0 0

Copy link

codecov bot commented Apr 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.55%. Comparing base (72cfdf6) to head (2fb52cd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7136      +/-   ##
==========================================
- Coverage   68.55%   68.55%   -0.01%     
==========================================
  Files        1259     1259              
  Lines      255844   255851       +7     
  Branches    26434    26434              
==========================================
- Hits       175392   175391       -1     
- Misses      73717    73722       +5     
- Partials     6735     6738       +3     
Flag Coverage Δ
Debug 68.55% <100.00%> (-0.01%) ⬇️
production 62.89% <100.00%> (-0.01%) ⬇️
test 88.70% <100.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
...crosoft.Data.Analysis/DataFrameColumnCollection.cs 81.06% <100.00%> (ø)
...st/Microsoft.Data.Analysis.Tests/DataFrameTests.cs 99.90% <100.00%> (+<0.01%) ⬆️

... and 4 files with indirect coverage changes

@feiyun0112 feiyun0112 changed the title fix #7135 Accessing data by column after adding columns to a DataFrame returns error data Apr 30, 2024
@michaelgsharp michaelgsharp merged commit a84579c into dotnet:main May 29, 2024
25 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessing data by column after adding columns to a DataFrame returns error data
3 participants