-
Notifications
You must be signed in to change notification settings - Fork 394
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 local scoring with multipicklist features #243
Conversation
Codecov Report
@@ Coverage Diff @@
## master #243 +/- ##
==========================================
+ Coverage 86.39% 86.43% +0.03%
==========================================
Files 312 312
Lines 10187 10187
Branches 336 564 +228
==========================================
+ Hits 8801 8805 +4
+ Misses 1386 1382 -4
Continue to review full report at Codecov.
|
@@ -117,4 +120,47 @@ class OpWorkflowRunnerLocalTest extends FlatSpec with PassengerSparkFixtureTest | |||
} score shouldBe expected | |||
} | |||
|
|||
it should "handle multi picklist features without throwing an exception" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the tests seems an overkill for such a simple check ;) let's think if we can make is simpler and not so labor intensive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's simply test it in FeatureTypeSparkConverterTest
@@ -196,7 +196,7 @@ case object FeatureTypeSparkConverter { | |||
|
|||
// Sets | |||
case wt if wt <:< weakTypeOf[t.MultiPickList] => (value: Any) => | |||
if (value == null) FeatureTypeDefaults.MultiPickList.value else value.asInstanceOf[MWrappedArray[String]].toSet | |||
if (value == null) FeatureTypeDefaults.MultiPickList.value else value.asInstanceOf[Seq[String]].toSet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you would also have to make the same fix for MultiPickListMap
…local-multipicklist
Thanks for the contribution! It looks like @kinfaikan is an internal user so signing the CLA is not required. However, we need to confirm this. |
Related issues
NA
Describe the proposed solution
Local scoring fails when there are multipicklist features because
Seq
can't be casted toMWrappedArray
. Solution is to cast multipicklist value toSeq
.Describe alternatives you've considered
NA
Additional context
NA