-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing Soda Cloud agent flow after real dev testing
- Loading branch information
1 parent
0105c27
commit d864199
Showing
4 changed files
with
121 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
soda-core/tests/soda_core/tests/components/manual_test_agent_flow.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from textwrap import dedent | ||
|
||
from dotenv import load_dotenv | ||
|
||
from conftest import configure_logging | ||
from soda_core.contracts.contract_verification import ContractVerification, ContractVerificationResult | ||
|
||
|
||
def main(): | ||
print("Verifying contract on agent") | ||
configure_logging() | ||
|
||
project_root_dir = __file__[: -len("/soda-core/tests/soda_core/tests/components/manual_test_agent_flow.py")] | ||
load_dotenv(f"{project_root_dir}/.env", override=True) | ||
|
||
contract_yaml_str: str = dedent(""" | ||
data_source: milan_throwaway | ||
dataset_prefix: [nyc, public] | ||
dataset: bus_breakdown_and_delays | ||
columns: | ||
- name: reason | ||
valid_values: [ 'Heavy Traffic', 'Other', 'Mechanical Problem', 'Won`t Start', 'Problem Run' ] | ||
checks: | ||
- type: invalid_count | ||
checks: | ||
- type: schema | ||
""").strip() | ||
|
||
soda_cloud_yaml_str = dedent(""" | ||
soda_cloud: | ||
bla: bla | ||
""").strip() | ||
|
||
contract_verification_result: ContractVerificationResult = ( | ||
ContractVerification.builder() | ||
.with_soda_cloud_yaml_str(soda_cloud_yaml_str) | ||
.with_contract_yaml_str(contract_yaml_str) | ||
.with_execution_on_soda_agent() | ||
.execute() | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters