Attribute¶
-
class
tamr_client.
Attribute
(url, name, type, is_nullable, description=None)[source]¶ A Tamr Attribute.
-
tamr_client.attribute.
by_resource_id
(session, dataset, id)[source]¶ Get attribute by resource ID
Fetches attribute from Tamr server
- Parameters
dataset (
Dataset
) – Dataset containing this attributeid (
str
) – Attribute ID
- 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, 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 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.