Attribute¶
-
class
tamr_client.Attribute(url, name, type, is_nullable, description=None)[source]¶ A Tamr Attribute.
-
tamr_client.attribute.by_resource_id(session, parent, id)[source]¶ Get attribute by resource ID
Fetches attribute from Tamr server
- Parameters
- Raises
attribute.NotFound – If no attribute could be found at the specified URL. Corresponds to a 404 HTTP error.
requests.HTTPError – If any other HTTP error is encountered.
- Return type
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 attributename (
str) – Name for the new attributetype (
Union[PrimitiveType,Array,Map,Record]) – Attribute type for the new attributeis_nullable (
bool) – Determines if the new attribute can contain NULL valuesdescription (
Optional[str]) – Description of the new attributeforce – If True, skips reserved attribute name check
- Return type
Attribute- Returns
The newly created attribute
- Raises
attribute.ReservedName – If attribute name is reserved.
attribute.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
- Return type
Attribute- Returns
The newly updated attribute
- Raises
attribute.NotFound – If no attribute could be found at the specified URL. Corresponds to a 404 HTTP error.
requests.HTTPError – If any other HTTP error is encountered.
-
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
attribute.NotFound – If no attribute could be found at the specified URL. Corresponds to a 404 HTTP error.
requests.HTTPError – If any other HTTP error is encountered.
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.