Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/5992#discussion_r33740745
--- Diff: mllib/src/main/scala/org/apache/spark/ml/util/SchemaUtils.scala
---
@@ -34,10 +34,11 @@ object SchemaUtils {
* @param colName column name
* @param dataType required column data type
*/
- def checkColumnType(schema: StructType, colName: String, dataType:
DataType): Unit = {
+ def checkColumnType(schema: StructType, colName: String, dataType:
DataType,
+ msg: String = ""): Unit = {
val actualDataType = schema(colName).dataType
require(actualDataType.equals(dataType),
- s"Column $colName must be of type $dataType but was actually
$actualDataType.")
+ s"Column $colName must be of type $dataType but was actually
$actualDataType.$msg")
--- End diff --
It might be easy to make the mistake of not added a space at the beginning.
Could you please modify msg to handle that? E.g.:
```
val message = if (msg.length > 0) " " + msg else ""
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]