Attribute

class tamr_client.Attribute(url, name, type, is_nullable, description=None)[source]

A Tamr Attribute.

See https://docs.tamr.com/reference#attribute-types

Parameters
  • url (URL) –

  • name (str) –

  • type (Union[PrimitiveType, Array, Map, Record]) –

  • is_nullable (bool) –

  • description (Optional[str]) –

tamr_client.attribute.from_resource_id(session, dataset, id)[source]

Get attribute by resource ID

Fetches attribute from Tamr server

Parameters
  • dataset (Dataset) – Dataset containing this attribute

  • id (str) – Attribute ID

Raises
Return type

Attribute

tamr_client.attribute.from_dataset_all(session, dataset)[source]

Get all attributes from a dataset

Parameters

dataset (Dataset) – Dataset containing the desired attributes

Return type

Tuple[Attribute, …]

Returns

The attributes for the specified dataset

Raises

requests.HTTPError – If an HTTP error is encountered.

tamr_client.attribute.to_json(attr)[source]

Serialize attribute into JSON

Parameters

attr (Attribute) – Attribute to serialize

Return type

Dict[str, Any]

Returns

JSON data representing the attribute

tamr_client.attribute.create(session, dataset, *, name, is_nullable, type=Array(inner_type=<PrimitiveType.STRING: 5>), description=None)[source]

Create an attribute

Posts a creation request to the Tamr server

Parameters
  • dataset (Dataset) – Dataset that should contain the new attribute

  • name (str) – Name for the new attribute

  • type (Union[PrimitiveType, Array, Map, Record]) – Attribute type for the new attribute

  • is_nullable (bool) – Determines if the new attribute can contain NULL values

  • description (Optional[str]) – Description of the new attribute

  • force – If True, skips reserved attribute name check

Return type

Attribute

Returns

The newly created attribute

Raises
  • ReservedName – If attribute name is reserved.

  • AlreadyExists – If an attribute already exists at the specified URL. Corresponds to a 409 HTTP error.

  • requests.HTTPError – If any other HTTP error is encountered.

tamr_client.attribute.update(session, attribute, *, description=None)[source]

Update an existing attribute

PUTS an update request to the Tamr server

Parameters
  • attribute (Attribute) – Existing attribute to update

  • description (Optional[str]) – Updated description for the existing attribute

Return type

Attribute

Returns

The newly updated attribute

Raises
tamr_client.attribute.delete(session, attribute)[source]

Deletes an existing attribute

Sends a deletion request to the Tamr server

Parameters

attribute (Attribute) – Existing attribute to delete

Raises

Exceptions

class tamr_client.attribute.AlreadyExists[source]

Raised when trying to create an attribute that already exists on the server

class tamr_client.attribute.NotFound[source]

Raised when referencing (e.g. updating or deleting) an attribute that does not exist on the server.

class tamr_client.attribute.ReservedName[source]

Raised when attempting to create an attribute with a reserved name