Link Search Menu Expand Document

Install Soda Core

Soda Core is a command-line interface (CLI) tool that enables you to scan the data in your data source to surface invalid, missing, or unexpected data.

Compatibility
Requirements
Install
Upgrade
Use Docker to run Soda Core
Install Soda Core Scientific
Go further

Compatibility

Use Soda Core to scan a variety of data sources.

Amazon Athena
Amazon Redshift
Apache Spark DataFrames1
GCP Big Query
PostgreSQL
Snowflake

1 For use with programmatic Soda scans, only.

Requirements

To use Soda Core, you must have installed the following on your system.

  • Python 3.8 or greater. To check your existing version, use the CLI command: python --version or python3 --version
    If you have not already installed Python, consider using pyenv to manage multiple versions of Python in your environment.
  • Pip 21.0 or greater. To check your existing version, use the CLI command: pip --version

Install

  1. Best practice dictates that you install the Soda Core CLI using a virtual environment. In your command-line interface tool, create a virtual environment in the .venv directory using the commands below. Depending on your version of Python, you may need to replace python with python3 in the first command.
    python -m venv .venv
    source .venv/bin/activate
    
  2. Upgrade pip inside your new virtual environment.
    pip install --upgrade pip
    
  3. Execute the following command, replacing soda-core-postgres with the install package that matches the type of data source you use to store data.
    pip install soda-core-postgres
    
Data source Install package
Amazon Athena soda-core-athena
Amazon Redshift soda-core-redshift
Apache Spark Dataframe
(For use with programmatic Soda scans, only.)
soda-core-spark-df
GCP Big Query soda-core-bigquery
PostgreSQL soda-core-postgres
Snowflake soda-core-snowflake

To deactivate the virtual environment, use the following command:

deactivate

Upgrade

To upgrade your existing Soda Core tool to the latest version, use the following command, replacing soda-core-redshift with the install package that matches the type of data source you are using.

pip install soda-core-redshift -U

Use Docker to run Soda Core

Use Soda’s Docker image in which Soda Core Scientific is pre-installed.

  1. If you have not already done so, install Docker in your local environment.
  2. From Terminal, run the following command to pull the latest Soda Core’s official Docker image.
    docker pull sodadata/soda-core
    
  3. Verify the pull by running the following command.
    docker run sodadata/soda-core --help
    

    Output:

     Usage: soda [OPTIONS] COMMAND [ARGS]...
    
     Soda Core CLI version 3.0.0bxx
    
     Options:
     --help  Show this message and exit.
    
     Commands:
     scan    runs a scan
     update-dro  updates a distribution reference file
    

    When you run the Docker image on a non-Linux/amd64 platform, you may see the following warning from Docker, which you can ignore.

    WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
    
  4. When you are ready to run a Soda scan, use the following command to run the scan via the docker image. Replace the placeholder values with your own file paths and names.
    docker run -v /path/to/your_soda_directory:/sodacl sodadata/soda-core scan -d your_data_source -c /sodacl/your_configuration.yml /sodacl/your_checks.yml
    

    Optionally, you can specify the version of Soda Core to use to execute the scan. This may be useful when you do not wish to use the latest released version of Soda Core to run your scans. The example scan command below specifies Soda Core version 3.0.0.

    docker run -v /path/to/your_soda_directory:/sodacl sodadata/soda-core:v3.0.0 scan -d your_data_source -c /sodacl/your_configuration.yml /sodacl/your_checks.yml
    
What does the scan command do?
  • docker run ensures that the docker engine runs a specific image.
  • -v mounts your SodaCL files into the container. In other words, it makes the configuration.yml and checks.yml files in your local environment available to the docker container. The command example maps your local directory to /sodacl inside of the docker container.
  • sodadata/soda-core refers to the image that docker run must use.
  • scan instructs Soda Core to execute a scan of your data.
  • -d indicates the name of the data source to scan.
  • -c specifies the filepath and name of the configuration YAML file.


Error: Mounts denied

If you encounter the following error, follow the procedure below.

docker: Error response from daemon: Mounts denied: 
The path /soda-core-test/files is not shared from the host and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
See https://docs.docker.com/desktop/mac for more info.

You need to give Docker permission to acccess your configuration.yml and checks.yml files in your environment. To do so:

  1. Access your Docker Dashboard, then select Preferences (gear symbol).
  2. Select Resources, then follow the Docker instructions to add your Soda project directory – the one you use to store your configuration.yml and checks.yml files – to the list of directories that can be bind-mounted into Docker containers.
  3. Click Apply & Restart, then repeat steps 2 - 4 above.


Error: Configuration path does not exist

If you encounter the following error, double check the syntax of the scan command in step 4 above.

  • Be sure to prepend /sodacl/ to both the congifuration.yml filepath and the checks.yml filepath.
  • Be sure to mount your files into the container by including the -v option. For example, -v /Users/MyName/soda_core_project:/sodacl.
Soda Core 3.0.0bxx
Configuration path 'configuration.yml' does not exist
Path "checks.yml" does not exist
Scan summary:
No checks found, 0 checks evaluated.
2 errors.
Oops! 2 errors. 0 failures. 0 warnings. 0 pass.
ERRORS:
Configuration path 'configuration.yml' does not exist
Path "checks.yml" does not exist


Install Soda Core Scientific

Install Soda Core Scientific to be able to use SodaCL distribution checks or anomaly score checks.

You have three installation options to choose from:

  1. Set up a virtual environment, as described in the Soda Core install documentation.
  2. Install Soda Core in your new virtual environment.
  3. Use the following command to install Soda Core Scientific.
pip install soda-core-scientific

Note that installing the Soda Core Scientific package also installs several scientific dependencies. Reference the soda-core-scientific setup file in the public GitHub repository for details.

Use Docker to run Soda Core Scientific

Use Soda’s Docker image in which Soda Core Scientific is pre-installed.

  1. If you have not already done so, install Docker in your local environment.
  2. From Terminal, run the following command to pull the latest Soda Core’s official Docker image.
    docker pull sodadata/soda-core
    
  3. Verify the pull by running the following command.
    docker run sodadata/soda-core --help
    

    Output:

     Usage: soda [OPTIONS] COMMAND [ARGS]...
    
     Soda Core CLI version 3.0.0bxx
    
     Options:
     --help  Show this message and exit.
    
     Commands:
     scan    runs a scan
     update-dro  updates a distribution reference file
    

    When you run the Docker image on a non-Linux/amd64 platform, you may see the following warning from Docker, which you can ignore.

    WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
    
  4. When you are ready to run a Soda scan, use the following command to run the scan via the docker image. Replace the placeholder values with your own file paths and names.
    docker run -v /path/to/your_soda_directory:/sodacl sodadata/soda-core scan -d your_data_source -c /sodacl/your_configuration.yml /sodacl/your_checks.yml
    

    Optionally, you can specify the version of Soda Core to use to execute the scan. This may be useful when you do not wish to use the latest released version of Soda Core to run your scans. The example scan command below specifies Soda Core version 3.0.0.

    docker run -v /path/to/your_soda_directory:/sodacl sodadata/soda-core:v3.0.0 scan -d your_data_source -c /sodacl/your_configuration.yml /sodacl/your_checks.yml
    
What does the scan command do?
  • docker run ensures that the docker engine runs a specific image.
  • -v mounts your SodaCL files into the container. In other words, it makes the configuration.yml and checks.yml files in your local environment available to the docker container. The command example maps your local directory to /sodacl inside of the docker container.
  • sodadata/soda-core refers to the image that docker run must use.
  • scan instructs Soda Core to execute a scan of your data.
  • -d indicates the name of the data source to scan.
  • -c specifies the filepath and name of the configuration YAML file.


Error: Mounts denied

If you encounter the following error, follow the procedure below.

docker: Error response from daemon: Mounts denied: 
The path /soda-core-test/files is not shared from the host and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
See https://docs.docker.com/desktop/mac for more info.

You need to give Docker permission to acccess your configuration.yml and checks.yml files in your environment. To do so:

  1. Access your Docker Dashboard, then select Preferences (gear symbol).
  2. Select Resources, then follow the Docker instructions to add your Soda project directory – the one you use to store your configuration.yml and checks.yml files – to the list of directories that can be bind-mounted into Docker containers.
  3. Click Apply & Restart, then repeat steps 2 - 4 above.


Error: Configuration path does not exist

If you encounter the following error, double check the syntax of the scan command in step 4 above.

  • Be sure to prepend /sodacl/ to both the congifuration.yml filepath and the checks.yml filepath.
  • Be sure to mount your files into the container by including the -v option. For example, -v /Users/MyName/soda_core_project:/sodacl.
Soda Core 3.0.0bxx
Configuration path 'configuration.yml' does not exist
Path "checks.yml" does not exist
Scan summary:
No checks found, 0 checks evaluated.
2 errors.
Oops! 2 errors. 0 failures. 0 warnings. 0 pass.
ERRORS:
Configuration path 'configuration.yml' does not exist
Path "checks.yml" does not exist


Install Soda Core Scientific locally

The following works on Mac OS on a machine with the M1 ARM-based processor. Consult the sections below to troubleshoot errors that may arise.

From your command-line interface, use the following command to install Soda Core Scientific.

pip install soda-core-scientific

Error: No module named ‘wheel’

If you encounter the following error, follow the procedure below.

Collecting lightgbm>=2.2.3
  Using cached lightgbm-3.3.2.tar.gz (1.5 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/vj/7nxglgz93mv6cv472sl0pnm40000gq/T/pip-install-j0txphmm/lightgbm_327e689fd1a645dfa052e5669c31918c/setup.py", line 17, in <module>
          from wheel.bdist_wheel import bdist_wheel
      ModuleNotFoundError: No module named 'wheel'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
  1. Install wheel.
    pip install wheel
    
  2. Run the command to install Soda Core Scientific, again.
    pip install soda-core-scientific 
    


Error: RuntimeError: Count not find a ‘llvm-config’ binary

If you encounter the following error, follow the procedure below.

      RuntimeError: Could not find a `llvm-config` binary. There are a number of reasons this could occur, please see: https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html#using-pip for help.
      error: command '/Users/yourname/Projects/testing/venv/bin/python3' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for llvmlite
  1. To install llvmlite, you must have a llvm-config binary file that the llvmlite installation process uses. In Terminal, use homebrew to run the following command.
    brew install llvm@11
    
  2. Homebrew installs this file in /opt/homebrew/opt/llvm@11/bin/llvm-config. To ensure that the llvmlite installation process uses this binary file, run the following command.
    export LLVM_CONFIG=/opt/homebrew/opt/llvm@11/bin/llvm-config
    
  3. Run the command to install Soda Core Scientific, again.
    pip install soda-core-scientific 
    

Go further


Last modified on 01-Jul-22

Was this documentation helpful?
Share feedback in the Soda community on Slack.

Help improve our docs!

  • Request a docs change.
  • Edit this page in our GitHub repo.