Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ object EvaluatePython {

case udt: UserDefinedType[_] => makeFromJava(udt.sqlType)

case other => (obj: Any) => nullSafeConvert(other)(PartialFunction.empty)
case other => (obj: Any) => nullSafeConvert(obj)(PartialFunction.empty)
Copy link
Member

Choose a reason for hiding this comment

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

Hi, @sarutak . Can we have a test case for this?

Copy link
Member

Choose a reason for hiding this comment

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

+1

Copy link
Member

Choose a reason for hiding this comment

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

btw, for any input, this converter in this pattern returns null? I mean we cannot write it here like this?

case other => (_: Any) => null

Copy link
Member Author

@sarutak sarutak Jul 8, 2020

Choose a reason for hiding this comment

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

btw, for any input, this converter in this pattern returns null?

Yes so it's difficult to test based on the return value.
Or, how about testing that the converter still returns null, meaning there is no regression?

Copy link
Member

Choose a reason for hiding this comment

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

either way seems fine to me

}

private def nullSafeConvert(input: Any)(f: PartialFunction[Any, Any]): Any = {
Expand Down