Skip to content

Commit

Permalink
Turned forgotten check type colon into error
Browse files Browse the repository at this point in the history
  • Loading branch information
tombaeyens committed Feb 27, 2025
1 parent b735f8b commit 2062df2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions soda-core/src/soda_core/common/soda_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,12 @@ def _poll_remote_scan_finished(self, scan_id: str, max_retry: int = 5) -> bool:
self.logs.debug(f"Soda Cloud responded with {json.dumps(dict(response.headers))}\n{response.text}")
if response:
response_body_dict: Optional[dict] = response.json() if response else None
scan_status: str = response_body_dict.get("state") if response_body_dict else None
scan_state: str = response_body_dict.get("state") if response_body_dict else None
scan_cloud_url: str = response_body_dict.get("cloudUrl") if response_body_dict else None

self.logs.debug(f"Scan {scan_id} status is '{scan_status}'")
self.logs.info(f"Scan {scan_id} is finished with state'{scan_state}'. See {scan_cloud_url}")

if scan_status in REMOTE_SCAN_FINAL_STATES:
if scan_state in REMOTE_SCAN_FINAL_STATES:
return True

if attempt < max_retry:
Expand Down
4 changes: 2 additions & 2 deletions soda-core/src/soda_core/contracts/impl/contract_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ def _parse_checks(
check_body_yaml_object = check_yaml_object.read_object_opt(key=check_type_name)
elif isinstance(check_yaml_object, str):
check_type_name = check_yaml_object
self.logs.info(
self.logs.error(
f"{Emoticons.PINCHED_FINGERS} Mama Mia! You forgot the "
f"colon ':' behind the check '{check_type_name}'. For this once I'll "
f"pretend I didn't see it {Emoticons.SEE_NO_EVIL}"
f"still execute it {Emoticons.SEE_NO_EVIL}"
)
if isinstance(check_type_name, str):
if check_body_yaml_object is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ def main():
dataset: bus_breakdown_and_delays
columns:
- name: reason
valid_values: [ 'Heavy Traffic', 'Other', 'Mechanical Problem', 'Won`t Start', 'Problem Run' ]
checks:
- type: invalid_count
- invalid:
valid_values: [ 'Heavy Traffic', 'Other', 'Mechanical Problem', 'Won`t Start', 'Problem Run' ]
checks:
- type: schema
- schema:
""").strip()

soda_cloud_yaml_str = dedent("""
Expand Down

0 comments on commit 2062df2

Please sign in to comment.