prefect_soda_cloud.tasks
Collection of tasks to interact with Soda Cloud
Classes
Functions
get_scan_logs
Retrieve scan logs from Soda Cloud given the scan ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scan_id |
str
|
Scan identifier provided by Soda Cloud. |
required |
soda_cloud_auth_config |
SodaCloudAuthConfig
|
The auth configuration to use to trigger the scan. |
required |
Returns:
Type | Description |
---|---|
List[dict]
|
A list of dict, each dict being a Soda Cloud log message. |
Source code in prefect_soda_cloud/tasks.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
get_scan_status
Retrieve scan status from Soda Cloud given the scan ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scan_id |
str
|
Scan identifier provided by Soda Cloud. |
required |
soda_cloud_auth_config |
SodaCloudAuthConfig
|
The auth configuration to use to trigger the scan. |
required |
wait_for_scan_end |
bool
|
Whether to wait for the scan execution to finish or not. |
False
|
Returns:
Type | Description |
---|---|
dict
|
A dictionary that describes the status of the scan. |
Source code in prefect_soda_cloud/tasks.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
trigger_scan
Trigger a scan given its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scan_name |
str
|
The name of the scan to trigger. |
required |
soda_cloud_auth_config |
SodaCloudAuthConfig
|
The auth configuration to use to trigger the scan. |
required |
Returns:
Type | Description |
---|---|
str
|
The Scan identifier. |
from prefect_soda_cloud import SodaCloudAuthConfig, SodaCloudCredentials
from prefect_soda_cloud.tasks import trigger_scan
creds = SodaCloudCredentials(
user_or_api_key_id="the_user",
pwd_or_api_key_secret="the_password"
)
auth_config = SodaCloudAuthConfig(
api_base_url="https://cloud.soda.io",
creds=creds
)
scan_id = trigger_scan(
soda_cloud_auth_config=auth_config,
data_timestamp=None
)
Source code in prefect_soda_cloud/tasks.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|