Skip to content

Clean DataFrame meaningless code #6761

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

Merged
merged 1 commit into from
Jul 11, 2023
Merged

Clean DataFrame meaningless code #6761

merged 1 commit into from
Jul 11, 2023

Conversation

asmirnov82
Copy link
Contributor

Fixes #6754

  1. PrimitiveColumnContainer is internal class, PrimitiveColumnContainer(T[] values) is not used anywhere inside DataFrameProject and there is another constructor that can be used for the same purpose PrimitiveColumnContainer(IEnumerable values). so this unused contructor can be easily removed (taking into account, that it contains errors - seems due to copy-past of code from the append method)

  2. Line
    items[c] = items[c];
    is redundant, seems to appear after copy pasting from:

public static async Task<DataFrame> LoadFrom(DbDataReader reader)
...
  for (var c = 0; c < columnsCount; c++)
  {
     items[c] = reader.IsDBNull(c)  ? null : reader[c];
  }

Method has unit tests. Changes don't affect method behaviour

@@ -44,35 +44,6 @@ internal partial class PrimitiveColumnContainer<T> : IEnumerable<T?>
// Need a way to differentiate between columns initialized with default values and those with null values in SetValidityBit
internal bool _modifyNullCountWhileIndexing = true;

public PrimitiveColumnContainer(T[] values)
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we can always bring it back if we need it?

Thanks for finding and cleaning up :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, it can be returned back anytime we want.
And actually these 2 issues were found by @nodakai, not by me :)

@JakeRadMSFT JakeRadMSFT merged commit 321158d into dotnet:main Jul 11, 2023
@asmirnov82 asmirnov82 deleted the 6754_clean_dataframe_code branch July 11, 2023 22:18
@ghost ghost locked as resolved and limited conversation to collaborators Aug 13, 2023
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.

Microsoft.Data.Analysis: meaningless lines of code?
2 participants