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

#5813 dataframe improve exception text #5819

Merged
merged 4 commits into from
May 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Microsoft.Data.Analysis/DataFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public GroupBy GroupBy(string columnName)
{
int columnIndex = _columnCollection.IndexOf(columnName);
if (columnIndex == -1)
throw new ArgumentException(Strings.InvalidColumnName, nameof(columnName));
throw new ArgumentException(String.Format(Strings.InvalidColumnName, columnName), nameof(columnName));

DataFrameColumn column = _columnCollection[columnIndex];
return column.GroupBy(columnIndex, this);
Expand Down Expand Up @@ -573,7 +573,7 @@ public DataFrame Append(IEnumerable<KeyValuePair<string, object>> row, bool inPl
int index = ret.Columns.IndexOf(columnName);
if (index == -1)
{
throw new ArgumentException(Strings.InvalidColumnName, nameof(columnName));
throw new ArgumentException(String.Format(Strings.InvalidColumnName, columnName), nameof(columnName));
}

DataFrameColumn column = ret.Columns[index];
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Data.Analysis/DataFrameColumnCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public DataFrameColumn this[string columnName]
int columnIndex = IndexOf(columnName);
if (columnIndex == -1)
{
throw new ArgumentException(Strings.InvalidColumnName, nameof(columnName));
throw new ArgumentException(String.Format(Strings.InvalidColumnName, columnName), nameof(columnName));
}
return this[columnIndex];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Data.Analysis/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
<value>Inconsistent null bitmaps and NullCounts</value>
</data>
<data name="InvalidColumnName" xml:space="preserve">
<value>Column does not exist</value>
<value>Column '{0}' does not exist</value>
</data>
<data name="InvalidFieldWidths" xml:space="preserve">
<value>All field widths, except the last element, must be greater than zero. A field width less than or equal to zero in the last element indicates the last field is of variable length.</value>
Expand Down