damccorm opened a new issue, #20702:
URL: https://github.com/apache/beam/issues/20702

   in io.gcp.datastore.v1new.types, Entity's method `to_client_entity` does not 
do it's conversions for repeated properties (arrays)
   
   I believe that changing the code of `to_client_entity` to the following 
should fix the issue
   
   
   ```
   
   def _to_client_value(self, value)
    if isinstance(value, Key):
      if not value.project:
        value.project
   = self.key.project
      value = value.to_client_key()
    if isinstance(value, Entity):
      if not value.key.project:
   
       value.key.project = self.key.project
      value = value.to_client_entity()
    return value
   
   def
   to_client_entity(self):
    """
    Returns a :class:`google.cloud.datastore.entity.Entity` instance that
   
   represents this entity.
    """
    res = entity.Entity(
      key=self.key.to_client_key(),
      exclude_from_indexes=tuple(self.exclude_from_indexes))
   
   for name, value in self.properties.items():
      if isinstance(value, list):
        value = [self._to_client_value(item)
   for item in value]
      else:
        value = self._to_client_value(value)
      res[name] = value
    return
   res
   ```
   
   
   
   
   
   
   
    
   
   Imported from Jira 
[BEAM-11441](https://issues.apache.org/jira/browse/BEAM-11441). Original Jira 
may contain additional context.
   Reported by: alexindaco.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to