Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan exit code 3: Error occurred while executing scan #2048

Open
manishjoshii opened this issue Apr 9, 2024 · 3 comments
Open

Scan exit code 3: Error occurred while executing scan #2048

manishjoshii opened this issue Apr 9, 2024 · 3 comments

Comments

@manishjoshii
Copy link

manishjoshii commented Apr 9, 2024

Hi All, I am a new user of soda and successfully connected soda to a BigQuery dataset. However, when I run the checks, it fails with exit code 3. Has anyone faced this issue? I am still debugging but would be grateful if anyone has a fix for this issue.
Based on the documentation, scan exit code 3 indicates a runtime issue.
Details are below:
Base code:

`from soda.scan import Scan

scan = Scan()

scan.add_configuration_yaml_file(file_path="configuration.yml")
scan.set_data_source_name('db_ca_kerry')

scan.add_sodacl_yaml_file("checks.yml")

exit_code = scan.execute()
print('exit_code is', exit_code)

scan.set_verbose(True)
scan.get_scan_results()
print(scan.get_logs_text())
`

The checks.yml file:
`checks:

  • row_count > 0`

I can connect successfully to the bigquery dataset

Error Message:
[18:17:02] Error occurred while executing scan. | 'NoneType' object has no attribute 'ensure_query_for_metric' exit_code is 3 INFO | Soda Core 3.3.1 ERROR | Error occurred while executing scan. | 'NoneType' object has no attribute 'ensure_query_for_metric'

Many thanks for your help and insights on the solution!

@tools-soda
Copy link

SAS-3207

@mjoshii
Copy link

mjoshii commented Apr 9, 2024

The checks.yml file had the dataset table name missing which I added. The revised checks.yml file is given below:

checks for <db_table_name>: - row_count > 0

This fixes the error and I am able to run soda successfully now.

@dirkgroenen
Copy link
Contributor

This error ('NoneType' object has no attribute 'ensure_query_for_metric') can be caused by some mistake in the formatting or usage of your checks.yml or configuration.yml. Some things to check:

  • Your formatting of the YAML files is correct YAML formatting (you can run it through an online formatter to assist you there, e.g. https://www.yamllint.com/)
  • You are setting the correct data source name (as how it's defined in your configuration.yml)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants