Skip to content

Commit 09265b0

Browse files
author
Aleksei Smirnov
authored
#5813 dataframe improve exception text (#5819)
* fix #5767 issue with DataFrame Merge method * #5813 Improve exception text on grouping by invalid column name
1 parent 7c34ab9 commit 09265b0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Microsoft.Data.Analysis/DataFrame.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ public GroupBy GroupBy(string columnName)
362362
{
363363
int columnIndex = _columnCollection.IndexOf(columnName);
364364
if (columnIndex == -1)
365-
throw new ArgumentException(Strings.InvalidColumnName, nameof(columnName));
365+
throw new ArgumentException(String.Format(Strings.InvalidColumnName, columnName), nameof(columnName));
366366

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

579579
DataFrameColumn column = ret.Columns[index];

src/Microsoft.Data.Analysis/DataFrameColumnCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public DataFrameColumn this[string columnName]
161161
int columnIndex = IndexOf(columnName);
162162
if (columnIndex == -1)
163163
{
164-
throw new ArgumentException(Strings.InvalidColumnName, nameof(columnName));
164+
throw new ArgumentException(String.Format(Strings.InvalidColumnName, columnName), nameof(columnName));
165165
}
166166
return this[columnIndex];
167167
}

src/Microsoft.Data.Analysis/Strings.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
<value>Inconsistent null bitmaps and NullCounts</value>
185185
</data>
186186
<data name="InvalidColumnName" xml:space="preserve">
187-
<value>Column does not exist</value>
187+
<value>Column '{0}' does not exist</value>
188188
</data>
189189
<data name="InvalidFieldWidths" xml:space="preserve">
190190
<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>

0 commit comments

Comments
 (0)