### Quickstart: Run Checks and Start Dashboard Source: https://github.com/antonbarr-data/dqt/blob/main/docs/dashboard.md A quickstart example demonstrating how to define and run a check, then start the local dashboard in the same Python process. Ensure the dashboard is accessible via http://127.0.0.1:8080. ```python import pandas as pd import uvicorn from dqt import Runner, MemoryStore from dqt.checks.models import Check, CheckScope from dqt.dashboard import create_app # 1. Shared store store = MemoryStore() runner = Runner(store) # 2. Define and run a check check = Check( detector_slug="wasserstein_1", scope=CheckScope(schema_name="default", table_name="revenue"), ) reference = pd.DataFrame({"v": [100, 102, 98, 101, 99]}) current = pd.DataFrame({"v": [130, 128, 135, 129, 132]}) # +30% shift runner.run_in_memory(check, reference=reference, current=current) # 3. Start the dashboard app = create_app(store=store) uvicorn.run(app, host="127.0.0.1", port=8080) ``` -------------------------------- ### Start dqt dashboard Source: https://github.com/antonbarr-data/dqt/blob/main/docs/api/cli-reference.md Launch the local browser dashboard for visualizing data quality results. Requires the 'dashboard' extra to be installed. ```bash dqt dashboard ``` -------------------------------- ### Install dqt library Source: https://github.com/antonbarr-data/dqt/blob/main/docs/getting-started.md Install the core dqt library using pip. To enable the local browser dashboard, install with the 'dashboard' extra. ```bash pip install dqtlib ``` ```bash pip install "dqtlib[dashboard]" ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-08-dqt-mvp-phase1-foundations.md Run the 'make install' command to install all necessary Python packages for the project. This is a foundational step before running any other development tasks. ```bash make install ``` -------------------------------- ### Run Local DQT Stack Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/specs/2026-05-08-dqt-mvp-design.md Commands to install dependencies and start the local Docker stack, including database migrations and demo data seeding. ```bash # First time make install # uv sync + pnpm install ./run_local/start.sh # Docker stack up + migrations + demo seed ``` -------------------------------- ### CLI: Start Dashboard Source: https://github.com/antonbarr-data/dqt/blob/main/docs/dashboard.md Start the DQT dashboard directly from the command line. The CLI starts with an empty in-memory store. ```bash dqt dashboard ``` ```bash dqt dashboard --port 9000 ``` ```bash dqt dashboard --host 0.0.0.0 --port 8080 ``` -------------------------------- ### Install dqtlib with Optional Features Source: https://github.com/antonbarr-data/dqt/blob/main/README.md Install the core dqtlib library and CLI, or include optional dependencies for specific functionalities like LLM Wiki synthesis, local dashboard, reporting, time-series forecasting, causal discovery, and deep learning detectors. The 'all' option installs all features. ```bash pip install dqtlib ``` ```bash pip install "dqtlib[wiki]" ``` ```bash pip install "dqtlib[dashboard]" ``` ```bash pip install "dqtlib[reports]" ``` ```bash pip install "dqtlib[forecast]" ``` ```bash pip install "dqtlib[causal]" ``` ```bash pip install "dqtlib[deep]" ``` ```bash pip install "dqtlib[all]" ``` -------------------------------- ### Install dqt CLI Source: https://github.com/antonbarr-data/dqt/blob/main/docs/cli/README.md Install the dqt CLI using pip. This command also installs the dqt library as a dependency. ```bash pip install dqt-cli ``` -------------------------------- ### Install airflow-providers-dqt Source: https://github.com/antonbarr-data/dqt/blob/main/docs/releases/v0.7.2.md Install the provider package using pip. ```bash pip install airflow-providers-dqt ``` -------------------------------- ### Install DQT for HTML Reports Source: https://github.com/antonbarr-data/dqt/blob/main/README.md Install the DQT library with the 'reports' extra to enable HTML report generation. ```bash pip install "dqt[reports]" ``` -------------------------------- ### Install dqt using pip Source: https://github.com/antonbarr-data/dqt/blob/main/README.md Install the dqt library using pip. This command installs the core Python package. ```bash pip install dqtlib ``` -------------------------------- ### Start local dqt dashboard Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-12-v043-reviewer-corrections.md Command to start the local dqt dashboard, specifying the host and port. ```python import typer def dashboard_command( port: int = typer.Option(8080, "--port", "-p", help="Port to listen on"), host: str = typer.Option("127.0.0.1", "--host", help="Host to bind"), ) -> None: """Start the local dqt dashboard (requires dqtlib[dashboard]).""" try: import uvicorn except ImportError: typer.echo("Error: dqtlib[dashboard] is required. Run: pip install 'dqtlib[dashboard]'", err=True) raise typer.Exit(code=1) from dqt.dashboard import create_app from dqt.store.memory import MemoryStore store = MemoryStore() app = create_app(store=store) typer.echo(f"dqt dashboard → http://{host}:{port}") uvicorn.run(app, host=host, port=port) ``` -------------------------------- ### Start Development Web Server Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/specs/2026-05-08-dqt-mvp-design.md Use this command to start the Next.js development web server. It runs on port 3000 and includes hot reloading. ```bash make dev-web ``` -------------------------------- ### Install DQT with Dashboard Support Source: https://github.com/antonbarr-data/dqt/blob/main/README.md Install the dqtlib package with the dashboard extra to enable the local dashboard functionality. This command installs the necessary dependencies for running the dashboard. ```bash pip install "dqtlib[dashboard]" ``` -------------------------------- ### dqt Full Annotated Manifest Example Source: https://github.com/antonbarr-data/dqt/blob/main/docs/cli/README.md A comprehensive example of a dqt manifest YAML file, including source configuration (DuckDB) and other sections. ```yaml version: "1" # ------------------------------------------------------------------- # Source: a DuckDB file containing the warehouse export # ------------------------------------------------------------------- source: type: duckdb id: local_warehouse database: ./data/warehouse.duckdb ``` -------------------------------- ### Install dqt and set API key Source: https://github.com/antonbarr-data/dqt/blob/main/docs/wiki.md Install the dqt CLI and set your Anthropic API key as an environment variable before running commands. ```bash pip install dqt-cli # anthropic>=0.26 bundled export ANTHROPIC_API_KEY=sk-ant-... ``` -------------------------------- ### Install dqt Benchmark Dependencies Source: https://github.com/antonbarr-data/dqt/blob/main/examples/benchmarks/README.md Installs necessary Python packages for running the dqt benchmark suite. Ensure you have pip installed. ```bash pip install dqtlib numpy pandas scipy scikit-learn statsmodels stumpy ``` -------------------------------- ### Start Development Server Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/specs/2026-05-08-dqt-mvp-design.md Use this command to start the FastAPI development server. It runs on port 8000 and includes hot reloading. ```bash make dev-server ``` -------------------------------- ### Start dqt dashboard on custom port and host Source: https://github.com/antonbarr-data/dqt/blob/main/docs/api/cli-reference.md Start the dqt dashboard, specifying a custom host and port. This allows for flexible deployment and access. ```bash dqt dashboard --host 0.0.0.0 --port 8080 ``` -------------------------------- ### Benchmark Suite README Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-14-dqt-095-to-100.md Markdown content for the benchmark suite README file. Includes a quick start guide with commands to install dependencies, run benchmarks, and generate summaries. ```markdown # dqt Benchmark Suite Reproducible precision/recall/F1 benchmarks for all 64 detectors. ## Quick start ```bash pip install dqtlib python scripts/run_benchmark_suite.py --quick python scripts/generate_benchmark_summary.py ``` `--quick` runs entirely on seeded synthetic data — no downloads, no network. Suitable for CI. ## Results See [results_summary.md](results_summary.md) for the latest per-detector table. ``` -------------------------------- ### Setup Test Client and Store Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-12-dqt-101.md Initializes a MemoryStore with sample data and returns a FastAPI TestClient and a check ID. Used for testing dashboard incident endpoints. ```python def _make_client(): store = MemoryStore() check_id = uuid4() run_id = uuid4() store.save_run(RunResult( check_id=check_id, run_id=run_id, detector_slug="null_fraction", started_at=datetime.now(timezone.utc), finished_at=datetime.now(timezone.utc), verdict=Verdict.fail, score=0.15, plain_english="15% null", details={"n_null": 15, "n_total": 100}, )) store.save_incident(Incident( check_id=check_id, run_id=run_id, detector_slug="null_fraction", severity=Verdict.fail, opened_at=datetime.now(timezone.utc), score=0.15, )) return TestClient(build_app(store)), str(check_id) ``` -------------------------------- ### Get dqt version Source: https://github.com/antonbarr-data/dqt/blob/main/docs/api/cli-reference.md Print the installed library version. This is useful for verifying the installation and checking compatibility. ```bash $ dqt version dqtlib 0.1.3 ``` -------------------------------- ### ECOD API Example Source: https://github.com/antonbarr-data/dqt/blob/main/docs/algorithms/outliers_multi/ecod.md Demonstrates how to build a check using the ECOD detector and integrate it with the Runner for outlier detection. This example shows the basic setup for using the library. ```python import pandas as pd from dqt import Check, Runner, MemoryStore # Build a check that wires this detector to a target table/column. check = Check( schema_name="public", table_name="fct_bookings", detector_slug="ecod", params={}, ) # Library usage: Runner pulls a sample via the configured adapter and runs the detector. runner = Runner(MemoryStore()) # result = runner.run(check, adapter) # adapter = DuckDBAdapter.from_dataframe(df) etc. # print(result.verdict, result.score, result.plain_english) ``` -------------------------------- ### Python API Example for Max in Range Check Source: https://github.com/antonbarr-data/dqt/blob/main/docs/algorithms/basic/max_in_range.md Demonstrates how to build a check using the dqt library to apply the max_in_range detector to a specific column. This example shows the setup for a check with defined parameters and comments on library usage with a Runner. ```python import pandas as pd from dqt import Check, Runner, MemoryStore # Build a check that wires this detector to a target table/column. check = Check( schema_name="public", table_name="orders", column_name="discount_pct", detector_slug="max_in_range", params={'min_val': 0.0, 'max_val': 1.0}, ) # Library usage: Runner pulls a sample via the configured adapter and runs the detector. runner = Runner(MemoryStore()) # result = runner.run(check, adapter) # adapter = DuckDBAdapter.from_dataframe(df) etc. # print(result.verdict, result.score, result.plain_english) ``` -------------------------------- ### dqt Wiki Sync Output Example Source: https://github.com/antonbarr-data/dqt/blob/main/docs/recipes/18_llm_wiki_workflow.md Example output from running `dqt wiki sync`, showing the number of files embedded and linked, and indicating unlinked files that may require `dqt wiki link --suggest`. ```text Syncing ./docs/metrics/ (14 files)... embedded: 14 linked: 9 (5 unlinked - run: dqt wiki link --suggest) Wiki coverage: 9/14 metrics documented Governance check: documentation_coverage WARN 5 finance metrics unlinked ``` -------------------------------- ### Python API Example for Min in Range Check Source: https://github.com/antonbarr-data/dqt/blob/main/docs/algorithms/basic/min_in_range.md This example demonstrates how to configure and use the `min_in_range` detector within a Python application using the `dqt` library. It shows the setup for a check targeting a specific table and column, including defining the min and max bounds. ```python import pandas as pd from dqt import Check, Runner, MemoryStore # Build a check that wires this detector to a target table/column. check = Check( schema_name="public", table_name="orders", column_name="amount", detector_slug="min_in_range", params={'min_val': 0.0, 'max_val': 1000000.0}, ) # Library usage: Runner pulls a sample via the configured adapter and runs the detector. runner = Runner(MemoryStore()) # result = runner.run(check, adapter) # adapter = DuckDBAdapter.from_dataframe(df) etc. # print(result.verdict, result.score, result.plain_english) ``` -------------------------------- ### Make start-server-prod.sh Executable Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-08-dqt-mvp-phase1-foundations.md Ensures the production server start script has execute permissions. ```bash chmod +x run_local/start-server-prod.sh ``` -------------------------------- ### Python API Example for Quantile in Range Check Source: https://github.com/antonbarr-data/dqt/blob/main/docs/algorithms/basic/quantile_in_range.md This example demonstrates how to build a check using the dqt library to monitor the 95th percentile of response times, ensuring it stays within 0.0 and 2000.0 ms. It shows the setup for a specific table, column, and detector with its parameters. ```python import pandas as pd from dqt import Check, Runner, MemoryStore # Build a check that wires this detector to a target table/column. check = Check( schema_name="public", table_name="api_requests", column_name="response_ms", detector_slug="quantile_in_range", params={'quantile': 0.95, 'min_val': 0.0, 'max_val': 2000.0}, ) # Library usage: Runner pulls a sample via the configured adapter and runs the detector. runner = Runner(MemoryStore()) # result = runner.run(check, adapter) # adapter = DuckDBAdapter.from_dataframe(df) etc. # print(result.verdict, result.score, result.plain_english) ``` -------------------------------- ### API Example for Grubbs' Test Source: https://github.com/antonbarr-data/dqt/blob/main/docs/algorithms/outliers_uni/grubbs.md Demonstrates how to build a check using the Grubbs' detector and wire it to a target table and column. This example requires pandas and dqt libraries. The runner usage is commented out but shows how to execute the check with an adapter. ```python import pandas as pd from dqt import Check, Runner, MemoryStore # Build a check that wires this detector to a target table/column. check = Check( schema_name="public", table_name="fct_gigs", column_name="price_usd", detector_slug="grubbs", params={}, ) # Library usage: Runner pulls a sample via the configured adapter and runs the detector. runner = Runner(MemoryStore()) # result = runner.run(check, adapter) # adapter = DuckDBAdapter.from_dataframe(df) etc. # print(result.verdict, result.score, result.plain_english) ``` -------------------------------- ### Column Pair Comparison Check Setup Source: https://github.com/antonbarr-data/dqt/blob/main/docs/algorithms/basic/column_pair_comparison.md Build a check that wires the column_pair_comparison detector to a target table/column. This example demonstrates setting up a check for timestamp ordering. ```python import pandas as pd from dqt import Check, Runner, MemoryStore # Build a check that wires this detector to a target table/column. check = Check( schema_name="public", table_name="orders", detector_slug="column_pair_comparison", params={'col_a': 'shipped_at', 'col_b': 'created_at', 'operator': '>='}, ) # Library usage: Runner pulls a sample via the configured adapter and runs the detector. runner = Runner(MemoryStore()) # result = runner.run(check, adapter) # adapter = DuckDBAdapter.from_dataframe(df) etc. # print(result.verdict, result.score, result.plain_english) ``` -------------------------------- ### GitHub Actions workflow for dqt Source: https://github.com/antonbarr-data/dqt/blob/main/docs/api/cli-reference.md Example GitHub Actions workflow to automate data quality checks on a schedule or on push events. It installs dqt, runs checks, and uploads results as an artifact. ```yaml # .github/workflows/dq.yml name: Data Quality on: schedule: - cron: "0 6 * * *" # daily at 06:00 UTC push: paths: - "checks/**" jobs: dq: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.12" - run: pip install dqtlib - run: dqt run checks/gigler.yaml --output json > dq_results.json - uses: actions/upload-artifact@v4 with: name: dq-results path: dq_results.json ``` -------------------------------- ### Build and Run MAD Outlier Check Source: https://github.com/antonbarr-data/dqt/blob/main/docs/algorithms/outliers_uni/mad_outlier_fraction.md Example of how to build a check using the MAD outlier fraction detector and prepare it for execution with a runner. This setup is for a specific table and column, with a custom threshold. ```python import pandas as pd from dqt import Check, Runner, MemoryStore # Build a check that wires this detector to a target table/column. check = Check( schema_name="public", table_name="fct_gigs", column_name="price_usd", detector_slug="mad_outlier_fraction", params={'threshold': 3.5}, ) # Library usage: Runner pulls a sample via the configured adapter and runs the detector. runner = Runner(MemoryStore()) # result = runner.run(check, adapter) # adapter = DuckDBAdapter.from_dataframe(df) etc. # print(result.verdict, result.score, result.plain_english) ``` -------------------------------- ### Seed and Reset Demo Data with CLI Source: https://github.com/antonbarr-data/dqt/blob/main/docs/releases/v0.4.5.md Use `dqt demo seed` to populate a local demo directory with synthetic data and checks, or `dqt demo reset` to clear it. Ideal for quick demonstrations and getting started. ```bash dqt demo seed dqt demo reset ``` -------------------------------- ### Python Completeness Check Example Source: https://github.com/antonbarr-data/dqt/blob/main/docs/algorithms/completeness.md Demonstrates how to set up and run a completeness check using the `dqt` library. This check is configured with no specific parameters, relying on default thresholds. The result of the check can be 'pass', 'warn', or 'fail'. ```python from dqt import Check, Runner, MemoryStore from dqt.algorithms.basic.completeness import CompletenessDetector # CompletenessDetector() # no params — inverse of null_fraction; score = fraction of non-null values (1.0 = fully complete) check = Check( schema_name="public", table_name="orders", column_name="email", detector_slug="completeness", params={}, ) # result = Runner(MemoryStore()).run(check, adapter) # print(result.verdict) # pass / warn / fail ``` -------------------------------- ### HBOS Detector Example Source: https://github.com/antonbarr-data/dqt/blob/main/docs/algorithms/hbos.md Demonstrates how to use the HBOSDetector for outlier detection. It includes creating reference and current data, initializing the detector, fitting it to the reference data, and scoring the current data to get anomaly verdicts and details. ```python import pandas as pd import numpy as np from dqt.algorithms.outliers_multi.hbos import HBOSDetector rng = np.random.default_rng(42) n = 5000 # Reference Gigler gig listing features ref = pd.DataFrame({ "price_usd": rng.lognormal(mean=3.2, sigma=0.7, size=n), "rating_avg": rng.uniform(3.5, 5.0, size=n), }) # Inject anomalies: suspiciously cheap + suspiciously high rating anomalous = pd.DataFrame({ "price_usd": [1.0, 1.5, 2.0, 1.0, 1.5], "rating_avg": [5.0, 5.0, 5.0, 4.99, 4.98], }) curr = pd.concat([ref.sample(1000, random_state=9), anomalous], ignore_index=True) det = HBOSDetector( n_bins=20, # histogram bins per column; 20 is a good default for columns with 1k–100k distinct values; # increase to 50 for high-cardinality continuous columns; # decrease to 10 for low-cardinality or sparse columns ) state = det.fit(ref) result = det.score(curr, state) print(result.verdict) # warn or fail print(result.plain_english) # "0.5% of rows with HBOS score above reference 99th percentile" print(result.details) # {"outlier_fraction": 0.005, "score_threshold": ...} ``` -------------------------------- ### Onboard a new analyst with data dictionary Source: https://github.com/antonbarr-data/dqt/blob/main/docs/semantic-layer.md Create a one-page data dictionary for a platform domain to help new analysts understand the warehouse. This provides a concise overview of available data assets. ```bash Read all files in wiki/datasets/ and wiki/metrics/. Write a 1-page data dictionary for the platform domain, suitable for a new analyst who has never seen the warehouse. ``` -------------------------------- ### Prophet Anomaly Detection Example Source: https://github.com/antonbarr-data/dqt/blob/main/docs/algorithms/prophet_anomaly.md Demonstrates fitting the ProphetAnomalyDetector on a reference dataset and scoring a current dataset to identify anomalies. Requires the 'dqt[forecast]' extra to be installed. The `interval_width` parameter controls the confidence interval for anomaly detection. ```python # Requires: pip install 'dqt[forecast]' import pandas as pd import numpy as np from dqt.algorithms.timeseries.prophet_anomaly import ProphetAnomalyDetector rng = np.random.default_rng(13) dates = pd.date_range("2023-01-01", periods=180, freq="D") # fct_bookings: daily revenue with weekly seasonality and an upward trend dow_effect = np.tile([1.0, 0.9, 0.85, 0.88, 1.05, 1.35, 1.25], 26)[:180] trend = np.linspace(12000, 15000, 180) noise = rng.normal(0, 400, 180) revenue = trend * dow_effect + noise ref = pd.DataFrame({"revenue_usd": revenue[:150]}, index=dates[:150]) curr = pd.DataFrame({"revenue_usd": revenue[150:].copy()}, index=dates[150:]) # Simulate a 5-day revenue anomaly (e.g. payment processor outage) curr.iloc[2:7, 0] *= 0.40 det = ProphetAnomalyDetector( interval_width=0.95, # confidence interval width; 0.95 flags points outside the 95% credible # interval; lower to 0.80 for stricter alerting (more false positives); # raise to 0.99 to only flag extreme outliers; requires pip install dqt[forecast] ) state = det.fit(ref) # ImportError here if prophet is not installed result = det.score(curr, state) print(result.verdict) # fail print(result.score) # ~0.17 (5 of 30 days anomalous) print(result.plain_english) # "5 of 30 values outside Prophet 95% uncertainty interval (16.7%)" ``` -------------------------------- ### Install Recharts (NPM/Yarn) Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-16-dqt-phase2-m2.md Commands to check if recharts is installed and to install it if necessary. This is a prerequisite for using the SeriesChart component. ```bash cd apps/web && pnpm list recharts ``` ```bash pnpm add recharts ``` -------------------------------- ### PSI API Example Source: https://github.com/antonbarr-data/dqt/blob/main/docs/algorithms/drift/psi.md Demonstrates how to set up and use the PSI detector within the DQT library. This involves creating a Check object with the PSI detector and parameters, and then using a Runner to execute the check against data. ```python import pandas as pd from dqt import Check, Runner, MemoryStore # Build a check that wires this detector to a target table/column. check = Check( schema_name="public", table_name="fct_bookings", column_name="amount_paid_usd", detector_slug="psi", params={'n_bins': 10}, ) # Library usage: Runner pulls a sample via the configured adapter and runs the detector. runner = Runner(MemoryStore()) # result = runner.run(check, adapter) # adapter = DuckDBAdapter.from_dataframe(df) etc. # print(result.verdict, result.score, result.plain_english) ``` -------------------------------- ### Create .env.example for Secrets Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-08-dqt-mvp-phase1-foundations.md Generate an example environment file to document required secrets. This file is safe to commit and serves as a template for developers to create their local .env files with actual sensitive values. ```bash # dqt secrets — copy to .env and fill in actual values. # NEVER commit .env. This file (.env.example) is safe to commit. # Warehouse credential encryption key # Generate: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())" DQT_CREDS_KEY= # JWT signing key # Generate: python -c "import secrets; print(secrets.token_hex(32))" JWT_SECRET_KEY= # Anthropic API key (for AI agent) ANTHROPIC_API_KEY=sk-ant-... ``` -------------------------------- ### Build and Publish DQT to PyPI Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-12-dqt-94-to-100.md Builds the DQT package using 'uv build' and then publishes the distribution files (tar.gz and wheel) to PyPI using 'uv publish'. Requires a UV_PUBLISH_TOKEN environment variable. ```bash uv build --package dqtlib ``` ```bash UV_PUBLISH_TOKEN=$(grep "^UV_PUBLISH_TOKEN" .env | cut -d= -f2-) \ uv publish dist/dqtlib-0.8.8.tar.gz dist/dqtlib-0.8.8-py3-none-any.whl \ --token "$UV_PUBLISH_TOKEN" ``` -------------------------------- ### Create Benchmark Notebook Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-12-v043-reviewer-corrections.md Initializes a new Jupyter notebook and sets up metadata for a Python 3 kernel. This is a foundational step for creating the benchmark environment. ```python import nbformat as nbf nb = nbf.v4.new_notebook() nb.metadata["kernelspec"] = {"display_name": "Python 3", "language": "python", "name": "python3"} cells = [] def code(src): return nbf.v4.new_code_cell(src) def md(src): return nbf.v4.new_markdown_cell(src) ``` -------------------------------- ### Test Prophet ImportError When Not Installed Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-11-group-b-detectors.md Tests that ProphetAnomalyDetector raises an ImportError with an installation hint when the prophet package is not installed. This test should be run when prophet is not available. ```python def test_prophet_raises_import_error_when_not_installed(): """When prophet is not installed the detector must raise ImportError with an install hint.""" try: import prophet # noqa: F401 pytest.skip("prophet is installed; stub test not applicable") except ImportError: pass from dqt.algorithms.timeseries.prophet_anomaly import ProphetAnomalyDetector import pandas as pd import numpy as np det = ProphetAnomalyDetector() df = pd.DataFrame({"value": np.random.default_rng(0).normal(0, 1, 50)}) with pytest.raises(ImportError, match="dqt\[forecast\]"): det.fit(df) ``` -------------------------------- ### Initialize PostgresAdapter Source: https://github.com/antonbarr-data/dqt/blob/main/docs/api/adapters.md Connect to a live PostgreSQL database using connection parameters like host, port, database, user, and password. It's recommended to verify connectivity using `health_check` before running checks. ```python from dqt.adapters.postgres import PostgresAdapter adapter = PostgresAdapter( host="localhost", port=5432, database="gigler_prod", user="dqt_readonly", password="...", ) # Verify connectivity before running checks health = adapter.health_check() print(health.ok, health.latency_ms) ``` -------------------------------- ### Install dbt-dqt Source: https://github.com/antonbarr-data/dqt/blob/main/docs/releases/v0.7.1.md Install the dbt-dqt package using pip. ```bash pip install dbt-dqt ``` -------------------------------- ### Install dagster-dqt Source: https://github.com/antonbarr-data/dqt/blob/main/docs/releases/v0.7.3.md Install the dagster-dqt package using pip. ```bash pip install dagster-dqt ``` -------------------------------- ### Make start.sh Executable Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-08-dqt-mvp-phase1-foundations.md Ensures the start script has execute permissions. ```bash chmod +x run_local/start.sh ``` -------------------------------- ### Install pnpm Dependencies Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-08-dqt-mvp-phase1-foundations.md Command to install all project dependencies using pnpm within the 'apps/web' directory. Expected to install approximately 400 packages without errors. ```bash cd apps/web && pnpm install ``` -------------------------------- ### Install and Run Pytest Command Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-08-dqt-mvp-phase2a-library-core.md Command to navigate to the DQT packages directory, set up a virtual environment with uv, and run pytest for the runner tests. ```bash cd packages/dqt && uv run pytest tests/runner/test_runner.py -v ``` -------------------------------- ### Install Dashboard Extras Source: https://github.com/antonbarr-data/dqt/blob/main/docs/dashboard.md Install the necessary extras for the DQT dashboard functionality using pip. ```bash pip install 'dqtlib[dashboard]' ``` -------------------------------- ### DQT Metrics Serve CLI - Generate Token Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-16-dqt-phase2.md Demonstrates starting the `dqt metrics serve` CLI with the `--generate-token` option to create a new authentication token. ```bash dqt metrics serve --generate-token ``` -------------------------------- ### Verify dqt installation Source: https://github.com/antonbarr-data/dqt/blob/main/docs/getting-started.md Check if the dqt library has been installed correctly by running the version command in your terminal. ```bash dqt version # dqtlib 0.4.4 ``` -------------------------------- ### dqt wiki status output example Source: https://github.com/antonbarr-data/dqt/blob/main/docs/wiki.md Example output of 'dqt wiki status' showing the sync status for different document groups, including the number of documents, status, and last sync time. ```bash Wiki sync status Group Docs Status Last synced semantic 2 up to date 2026-05-12 tickets 3 changed 2026-05-10 code 1 pending - reports 2 up to date 2026-05-12 ``` -------------------------------- ### Build and Publish DQT Package Source: https://github.com/antonbarr-data/dqt/blob/main/docs/superpowers/plans/2026-05-14-dqt-095-to-100.md Build the DQT library package using uv build and then publish it to the distribution repository using uv publish. The asterisk in the publish command allows for wildcard matching of the built package. ```bash cd c:\anton\dqt && uv build --package dqtlib && uv publish dist/dqtlib-1.0.0* ```