This is an automated email from the ASF dual-hosted git repository.
emergentorder pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/predictionio.git
The following commit(s) were added to refs/heads/develop by this push:
new d5b5ad5 Fix a bug that prevents events with targetEntityType and
targetEntity… (#522)
d5b5ad5 is described below
commit d5b5ad54ddf0696d08cd4198816f8d6407f60982
Author: Alex Merritt <[email protected]>
AuthorDate: Wed Jul 17 11:02:01 2019 -0400
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
---
.../predictionio/data/store/python/PPythonEventStore.scala | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git
a/data/src/main/scala/org/apache/predictionio/data/store/python/PPythonEventStore.scala
b/data/src/main/scala/org/apache/predictionio/data/store/python/PPythonEventStore.scala
index 1d03634..be269a9 100644
---
a/data/src/main/scala/org/apache/predictionio/data/store/python/PPythonEventStore.scala
+++
b/data/src/main/scala/org/apache/predictionio/data/store/python/PPythonEventStore.scala
@@ -82,8 +82,17 @@ object PPythonEventStore {
Option(entityType),
Option(entityId),
Option(eventNames),
- Option(Option(targetEntityType)),
- Option(Option(targetEntityId)))(spark.sparkContext).map { e =>
+ targetEntityType match {
+ case null => None
+ case "" => Option(None)
+ case _ => Option(Option(targetEntityType))
+ },
+ targetEntityId match {
+ case null => None
+ case "" => Option(None)
+ case _ => Option(Option(targetEntityId))
+ }
+ )(spark.sparkContext).map { e =>
(
e.eventId,
e.event,