Attribute

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

A Tamr Attribute.

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

Parameters
  • url (URL) –

  • name (str) –

  • type (Union[Boolean, Double, Int, Long, String, Array, Map, Record]) –

  • description (Optional[str]) –

tamr_client.attribute.from_resource_id(session, dataset, id)

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)

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)

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=String()), description=None)

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[Boolean, Double, Int, Long, String, 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
tamr_client.attribute.update(session, attribute, *, description=None)

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)

Deletes an existing attribute

Sends a deletion request to the Tamr server

Parameters

attribute (Attribute) – Existing attribute to delete

Raises

Exceptions

class tamr_client.ReservedAttributeName[source]

Raised when attempting to create an attribute with a reserved name

class tamr_client.AttributeExists[source]

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

class tamr_client.AttributeNotFound[source]

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