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

Fix order of operations when using mkString in typeConversionInfo #3113

Merged
merged 4 commits into from
Aug 9, 2021
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,14 @@ abstract class RapidsMeta[INPUT <: BASE, BASE, OUTPUT <: BASE](
(cannotRunOnGpuBecauseOfSparkPlan || shouldThisBeRemoved) => "could " + replaceMessage
case Some(v) if v.isEmpty => "will " + replaceMessage
case Some(v) =>
noReplacementPossibleMessage(v mkString "; ")
noReplacementPossibleMessage(v.mkString("; "))
}

private def willBeRemovedInfo: String = shouldBeRemovedReasons match {
case None => ""
case Some(v) if v.isEmpty => ""
case Some(v) =>
val reasons = v mkString "; "
val reasons = v.mkString("; ")
s" but is going to be removed because $reasons"
}

Expand All @@ -327,7 +327,7 @@ abstract class RapidsMeta[INPUT <: BASE, BASE, OUTPUT <: BASE](
case Some(v) if v.isEmpty => ""
case Some(v) =>
"The data type of following expressions will be converted in GPU runtime: " +
Copy link
Collaborator

@razajafri razajafri Aug 5, 2021

Choose a reason for hiding this comment

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

nit: string interpolator can be used here?

(v mkString "; ")
(v.mkString("; "))
andygrove marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down Expand Up @@ -811,7 +811,8 @@ class DataTypeMeta(
def reasonForConversion: String = {
val reasonMsg = (if (typeConverted) reason else None)
.map(r => s", because $r").getOrElse("")
s"Converted ${wrapped.get} to ${dataType.get}" + reasonMsg
s"Converted ${wrapped.getOrElse("N/A")} to " +
s"${dataType.getOrElse("N/A")}" + reasonMsg
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: same here we can use $reasonMsg inside the string

}
}

Expand Down