Skip to content Skip to sidebar Skip to footer

Attributeerror: 'list' Object Has No Attribut 'has_key' In App Engine

I am having some issues with the app engine's bulkloader. Below I have inserted both the bulkloader.yaml, hs_transformers.py, and error log. Any idea as to what is generating this

Solution 1:

Glancing through the relevant code, looks like a bug.

You're post import function is run within dict_to_entity, which simply returns whatever your function returns. create_entity feeds whatever dict_to_entity returns into __track_max_id, which doesn't seem to properly account for a list or None.

I'd suggest you file this as a bug in the App Engine Issue tracker.

Note that you could fix this pretty easily in your local SDK. Basically change __track_max_id to look something like:

def__track_max_id(self, entity):
  """Check the entity to see it has a numeric ID higher than any seen so far.

  High IDs are stored in self.high_ids[path-to-entity-kind].
  They are not tracked if self.increment_id is None.

  Args:
    entity: An entity with a key.
  """ifnot self.increment_id:
    returnifnot entity:
    returnifisinstance(entity, datastore.Entity):
    entities = [entity]
  else:
    entities = entity

  for entity in entities:
    ifnot entity.key():
      continue
    key = entity.key()
    key_id = key.id()
    ifnot key_id:
      continue
    path = tuple(key.to_path()[:-1])
    if self.high_ids.get(path, 0) < key_id:
      self.high_ids[path] = key_id

Post a Comment for "Attributeerror: 'list' Object Has No Attribut 'has_key' In App Engine"