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.by_resource_id(session, parent, id)[source]

Get attribute by resource ID

Fetches attribute from Tamr server

Parameters
  • parent (Union[Dataset, CategorizationProject, MasteringProject, SchemaMappingProject, GoldenRecordsProject, UnknownProject]) – Dataset or project containing this attribute

  • id (str) – Attribute ID

Raises
Return type

Attribute

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, parent, *, 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
  • parent (Union[Dataset, CategorizationProject, MasteringProject, SchemaMappingProject, GoldenRecordsProject, UnknownProject]) – Dataset or project 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
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

class tamr_client.attribute.CannotCreateAttributesOnUnifiedDataset[source]

Raised when attempting to create an attribute on a unified dataset