Registry / data / soda-core-sqlserver

soda-core-sqlserver

JSON →
library3.5.6pypypiunverified

Soda Core SQL Server is a plugin for Soda Core, a data quality monitoring framework. It enables connecting to and scanning data quality checks against SQL Server databases. This library provides the necessary data source integration, allowing users to define checks on their SQL Server data using Soda's YAML-based configuration. Version 3.5.6 is current, and releases typically align with the active development cadence of the main `soda-core` library.

pip install soda-core-sqlserver
INSTALL
IMPORT
SIG · SODA-CORE-SQLSERVE
S
soda-core-sqlserver
datapythonv3.5.6
Install
7.9s avg
Import
Disk
72MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.5.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 73.9MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 7.9s · import 0.000s · 71MB
72MB installed
● package 72MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SQL Server Data Source Type (via configuration)
This package enables `type: sqlserver` in your `configuration.yml`. For programmatic scan execution: `from soda.scan import Scan`
`soda-core-sqlserver` is a plugin that auto-registers the 'sqlserver' data source type. There isn't a direct Python class import from this specific package that users commonly call. The primary programmatic interaction with Soda Core is through the `Scan` class from the `soda.scan` module, after the SQL Server data source is configured in YAML.

This quickstart demonstrates how to configure Soda Core to connect to a SQL Server database and run a simple data quality scan programmatically. It generates `configuration.yml` and `checks.yml` files, then executes a scan. Ensure your environment variables `SQLSERVER_HOST`, `SQLSERVER_DATABASE`, `SQLSERVER_USERNAME`, `SQLSERVER_PASSWORD` are set, and an ODBC driver for SQL Server is installed on your system. Replace placeholder values or environment variables with your actual SQL Server connection details.

import os from soda.scan import Scan # Ensure environment variables are set for the quickstart to run # For local testing, replace os.environ.get with actual values or create a .env file host = os.environ.get('SQLSERVER_HOST', 'localhost') port = os.environ.get('SQLSERVER_PORT', '1433') database = os.environ.get('SQLSERVER_DATABASE', 'your_database') username = os.environ.get('SQLSERVER_USERNAME', 'sa') password = os.environ.get('SQLSERVER_PASSWORD', 'your_password') # Create a dummy configuration.yml and checks.yml for demonstration # In a real scenario, these files would be persisted. config_yaml_content = f""" data_source: type: sqlserver host: "{host}" port: "{port}" database: "{database}" username: "{username}" password: "{password}" # Add other connection options if needed, e.g., for trusted connections or specific drivers # Example using system-installed ODBC Driver 17 for SQL Server on Linux/macOS: # connection_string_user_defined_options: "Driver={{ODBC Driver 17 for SQL Server}};Encrypt=no;TrustServerCertificate=yes;" # Example for Windows Trusted Connection (if your SQL Server supports it): # connection_string_user_defined_options: "Trusted_Connection=Yes;Encrypt=no;" """ checks_yaml_content = """ checks for demo_table: - row_count > 0 - missing_count(id) = 0 """ config_path = 'configuration.yml' checks_path = 'checks.yml' with open(config_path, 'w') as f: f.write(config_yaml_content) with open(checks_path, 'w') as f: f.write(checks_yaml_content) print("Configuration and checks files created. Running Soda Scan...") scan = Scan() scan.set_data_source_name('data_source') # Corresponds to the top-level key in configuration.yml scan.add_configuration_path(config_path) scan.add_checks_path(checks_path) scan.execute() if scan.has_failures(): print("Scan completed with failures.") else: print("Scan completed successfully without failures.") # Clean up generated files (optional, remove in persistent setups) os.remove(config_path) os.remove(checks_path)
soda --version
Debug
Known issues
breakingSoda Core v2.x and v3.x introduced significant changes in the configuration file format and CLI commands. `soda-core-sqlserver` versions are compatible with `soda-core` v3.x. Upgrading from v2.x requires updating your `configuration.yml` and `checks.yml` files.
fix
Consult the official Soda Core documentation for the v3.x configuration format and migration guides. Key changes include how data sources are defined and how scan commands are structured.
affects: All versions >=3.0.0 (relative to Soda Core)
gotchaWhile `soda-core-sqlserver` installs `pyodbc`, you still need an appropriate ODBC driver for SQL Server installed on your operating system (e.g., 'ODBC Driver 17 for SQL Server'). Without it, `pyodbc` cannot connect to the database.
fix
Install the correct Microsoft ODBC Driver for SQL Server for your operating system. On Linux/macOS, use package managers like `apt` or `brew`. On Windows, download from Microsoft's website. Verify installation with `odbcinst -q -d` (Linux/macOS) or check ODBC Data Source Administrator (Windows).
affects: All
gotchaSQL Server connection strings can be complex. Incorrect host, port, database, username, password, or driver options will lead to connection failures. Often, specific `connection_string_user_defined_options` are needed for trusted connections or custom setups (e.g., `Encrypt=no;TrustServerCertificate=yes;`).
fix
Carefully review your `configuration.yml` connection parameters. Test your connection details using a simple `pyodbc` script or a database client tool first. Use `connection_string_user_defined_options` for advanced ODBC driver settings like specifying the exact driver name (e.g., `Driver={{ODBC Driver 17 for SQL Server}}`).
affects: All
Upgrade
Version history
3.5.6latest on PyPI · released Sep 24, 2025
Audit
Dependencies
soda-corerequiredCore data quality framework for running scans and checks.
pyodbcrequiredPython ODBC driver for connecting to SQL Server databases, included as a direct dependency.
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
2
Resources
soda-core-sqlserver — pip install soda-core-sqlserver · libregistry