Exceptions
blackline.exceptions
CollectionNotFoundError
Bases: Exception
Exception raised when an collection does not exist.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the missing collection. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the missing collection. |
required |
Raises:
Type | Description |
---|---|
CollectionNotFoundError
|
If an collection is not found. |
Example
try: fetch_collection_data(name) except CollectionNotFoundError as e: print(f"Collection '{e.name}' does not exist.")
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/exceptions.py
collection = collection
instance-attribute
FieldNotFoundError
Bases: Exception
Exception raised when an SQLite collection does not include a given column.
Attributes:
Name | Type | Description |
---|---|---|
collection_name |
str
|
The name of the collection. |
field_name |
str
|
The name of the missing column. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
collection_name |
str
|
The name of the collection. |
required |
field_name |
str
|
The name of the missing column. |
required |
Raises:
Type | Description |
---|---|
FieldNotFoundError
|
If an SQLite collection does not include the given column. |
Example
try: fetch_column_data(name, field_name) except FieldNotFoundError as e: print(f"Field '{e.field_name}' not found in collection '{e.name}'.")
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/exceptions.py
collection = collection
instance-attribute
field = field
instance-attribute
__init__(collection, field)
Source code in /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/exceptions.py
InvalidDatsetError
Bases: Exception
Exception raised when a Dataset is invalid.
Attributes:
Name | Type | Description |
---|---|---|
name |
The name of the invalid dataset. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the invalid dataset. |
required |
Raises:
Type | Description |
---|---|
InvalidDatasetError
|
If a catalogue is invalid. |
Example
try: validate_catalogue(name) except InvalidDatasetError as e: print(f"Dataset '{e.name}' is invalid.")
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/exceptions.py
InvalidFieldConstraintError
Bases: Exception
Exception raised when a SQLite column constraint is invalid for a given de-identification method.
Attributes:
Name | Type | Description |
---|---|---|
constraint_name |
str
|
The name of the invalid column constraint. |
deidentification_method |
str
|
The de-identification method being applied. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constraint_name |
str
|
The name of the invalid column constraint. |
required |
deidentification_method |
str
|
The de-identification method being applied. |
required |
Raises:
Type | Description |
---|---|
InvalidFieldConstraintError
|
If a column constraint is not compatible with the de-identification method. |
Example
try: apply_deidentification_method( field_name, constraint_name, deidentification_method ) except InvalidFieldConstraintError as e: print(f"Invalid column constraint '{e.constraint_name}' for de-identification method '{e.deidentification_method}'.") # noqa: E501