apache_beam.io.gcp.datastore.v1new.types module

Beam Datastore types.

class apache_beam.io.gcp.datastore.v1new.types.Query(kind=None, project=None, namespace=None, ancestor=None, filters=(), projection=(), order=(), distinct_on=(), limit=None)[source]

Bases: object

Represents a Datastore query.

Parameters:
  • kind – (str) The kind to query.

  • project – (str) Required. Project associated with query.

  • namespace – (str, ValueProvider(str)) (Optional) Namespace to restrict results to.

  • ancestor – (Key) (Optional) key of the ancestor to which this query’s results are restricted.

  • filters – (sequence of tuple[str, str, str], sequence of tuple[ValueProvider(str), ValueProvider(str), ValueProvider(str)]) Property filters applied by this query. The sequence is (property_name, operator, value).

  • projection – (sequence of string) fields returned as part of query results.

  • order – (sequence of string) field names used to order query results. Prepend - to a field name to sort it in descending order.

  • distinct_on – (sequence of string) field names used to group query results.

  • limit – (int) Maximum amount of results to return.

clone()[source]
class apache_beam.io.gcp.datastore.v1new.types.Key(path_elements: List[str | int], parent: Key | None = None, project: str | None = None, namespace: str | None = None)[source]

Bases: object

Represents a Datastore key.

The partition ID is represented by its components: namespace and project. If key has a parent, project and namespace should either be unset or match the parent’s.

Parameters:
  • path_elements – (list of str and int) Key path: an alternating sequence of kind and identifier. The kind must be of type str and identifier may be a str or an int. If the last identifier is omitted this is an incomplete key, which is unsupported in WriteToDatastore and DeleteFromDatastore. See google.cloud.datastore.key.Key for more details.

  • parent – (Key) (optional) Parent for this key.

  • project – (str) Project ID. Required unless set by parent.

  • namespace – (str) (optional) Namespace ID

static from_client_key(client_key)[source]
to_client_key()[source]

Returns a google.cloud.datastore.key.Key instance that represents this key.

class apache_beam.io.gcp.datastore.v1new.types.Entity(key: Key, exclude_from_indexes: Iterable[str] = ())[source]

Bases: object

Represents a Datastore entity.

Does not support the property value “meaning” field.

Parameters:
  • key – (Key) A complete Key representing this Entity.

  • exclude_from_indexes – (iterable of str) List of property keys whose values should not be indexed for this entity.

set_properties(property_dict)[source]

Sets a dictionary of properties on this entity.

Parameters:

property_dict – A map from property name to value. See google.cloud.datastore.entity.Entity documentation for allowed values.

static from_client_entity(client_entity)[source]
to_client_entity()[source]

Returns a google.cloud.datastore.entity.Entity instance that represents this entity.