Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit d5b5ad5

Browse files
Fix a bug that prevents events with targetEntityType and targetEntity… (#522)
* Fix a bug that prevents events with targetEntityType and targetEntityId set from being returned by find from PPythonEventStore * Fix formatting
1 parent 93f5aa6 commit d5b5ad5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

data/src/main/scala/org/apache/predictionio/data/store/python/PPythonEventStore.scala

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,17 @@ object PPythonEventStore {
8282
Option(entityType),
8383
Option(entityId),
8484
Option(eventNames),
85-
Option(Option(targetEntityType)),
86-
Option(Option(targetEntityId)))(spark.sparkContext).map { e =>
85+
targetEntityType match {
86+
case null => None
87+
case "" => Option(None)
88+
case _ => Option(Option(targetEntityType))
89+
},
90+
targetEntityId match {
91+
case null => None
92+
case "" => Option(None)
93+
case _ => Option(Option(targetEntityId))
94+
}
95+
)(spark.sparkContext).map { e =>
8796
(
8897
e.eventId,
8998
e.event,

0 commit comments

Comments
 (0)