{"id":5489,"library":"soda-core-snowflake","title":"Soda Core Snowflake Connector","description":"Soda Core Snowflake Connector is a plugin for Soda Core, enabling data quality monitoring and testing against Snowflake data warehouses. It extends Soda Core's capabilities to connect to and scan Snowflake databases for data quality checks. The current version is 3.5.6, and it typically releases new versions in alignment with Soda Core's release cycle.","status":"active","version":"3.5.6","language":"en","source_language":"en","source_url":"https://github.com/sodadata/soda-core-snowflake","tags":["data quality","observability","snowflake","sql","connector","data governance"],"install":[{"cmd":"pip install soda-core-snowflake","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"This is a plugin for Soda Core and requires 'soda-core' for its core functionality. Version compatibility (e.g., soda-core-snowflake==3.x.x requires soda-core==3.x.x) is crucial.","package":"soda-core","optional":false},{"reason":"Required for establishing connections to Snowflake.","package":"snowflake-connector-python","optional":false}],"imports":[{"note":"While 'Scan' is imported from 'soda-core', the 'soda-core-snowflake' library registers the necessary components to enable 'type: snowflake' data sources in your Soda Core configurations. Users do not typically import symbols directly from 'soda-core-snowflake' for interaction; its value is in extending Soda Core's data source capabilities.","symbol":"Scan","correct":"from soda.scan import Scan"}],"quickstart":{"code":"import os\nfrom soda.scan import Scan\n\n# Configure Snowflake connection details using environment variables for security\n# Ensure these environment variables are set before running:\n# SNOWFLAKE_HOST, SNOWFLAKE_ACCOUNT, SNOWFLAKE_USERNAME, SNOWFLAKE_PASSWORD,\n# SNOWFLAKE_ROLE, SNOWFLAKE_WAREHOUSE, SNOWFLAKE_DATABASE, SNOWFLAKE_SCHEMA\n\nconfiguration_yaml_content = f\"\"\"\ndata_source snowflake_db:\n  type: snowflake\n  host: {os.environ.get('SNOWFLAKE_HOST', 'your_snowflake_host.snowflakecomputing.com')}\n  account: {os.environ.get('SNOWFLAKE_ACCOUNT', 'your_account_identifier')}\n  username: {os.environ.get('SNOWFLAKE_USERNAME', 'your_username')}\n  password: {os.environ.get('SNOWFLAKE_PASSWORD', 'your_password')}\n  role: {os.environ.get('SNOWFLAKE_ROLE', 'SYSADMIN')}\n  warehouse: {os.environ.get('SNOWFLAKE_WAREHOUSE', 'COMPUTE_WH')}\n  database: {os.environ.get('SNOWFLAKE_DATABASE', 'SNOWFLAKE_SAMPLE_DATA')}\n  schema: {os.environ.get('SNOWFLAKE_SCHEMA', 'TPCH_SF100')}\n\"\"\"\n\n# Define a simple data quality check\nchecks_yaml_content = \"\"\"\nchecks for snowflake_db:\n  - row_count > 0: # Checks if the customer table in the specified schema is not empty\n      name: Check for non-empty customer table\n      from CUSTOMER\n\"\"\"\n\n# Create a Scan object from soda-core\nscan = Scan()\nscan.set_verbose(True)\nscan.add_configuration_yaml_str(configuration_yaml_content)\nscan.add_checks_yaml_str(checks_yaml_content)\n\n# Execute the scan\nscan.execute()\n\n# Process and print scan results\nif scan.has_failures():\n    print(\"\\n!!! Scan completed with FAILURES !!!\")\nelse:\n    print(\"\\nScan completed successfully.\")\n\nprint(\"\\n--- Scan Logs ---\")\nprint(scan.get_logs_text())\n","lang":"python","description":"This quickstart demonstrates how to programmatically connect to Snowflake using environment variables for credentials and run a simple data quality check with Soda Core. It requires `soda-core-snowflake` to be installed for the `type: snowflake` data source to be recognized."},"warnings":[{"fix":"Always install `soda-core-snowflake` and `soda-core` with matching major versions (e.g., `pip install 'soda-core>=3,<4' 'soda-core-snowflake>=3,<4'`)","message":"Version compatibility between `soda-core-snowflake` and `soda-core` is critical. For example, `soda-core-snowflake==3.x.x` must be used with `soda-core==3.x.x`. Mismatched major versions often lead to runtime errors or unexpected behavior.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Verify all connection parameters (host, account, username, password, role, warehouse, database, schema) are correct and that the user/role has necessary permissions. Test connection using a simple `snowflake-connector-python` script if issues persist.","message":"Incorrect or incomplete Snowflake connection parameters can cause connection failures. Common mistakes include missing `account` identifier, invalid `username`/`password`, or insufficient permissions for the specified `role`/`warehouse`/`database`/`schema`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Use environment variables (as shown in the quickstart), a secrets management service (e.g., AWS Secrets Manager, HashiCorp Vault), or a dedicated `.env` file loaded via `python-dotenv` for managing sensitive credentials.","message":"Hardcoding sensitive credentials (username, password, account ID) directly in `configuration.yml` or Python scripts is a security risk. This can expose sensitive data in version control or logs.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure `type: snowflake` is precisely written in your Soda Core data source configuration.","message":"The `data_source` type must be correctly specified as `type: snowflake` in your `configuration.yml` (or programmatic configuration). Typographical errors or using a generic type will prevent the `soda-core-snowflake` connector from being utilized.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}