Skip to main content
AI Code Reviews add automated code review to your CI pipeline. Datafold checks the SQL in each pull request against a set of style and best-practice rules for your organization, and posts its findings as inline comments with suggested changes. When combined with Data Diffs, AI Code Reviews give your team both code-level and data-level validation on every PR.
AI Code Reviews are an optional add-on to Datafold’s CI integration. If you prefer to use only Data Diffs, no changes are needed — your existing CI setup continues to work as before.

How It Works

1

The first CI run finishes

The review runs once per pull request, after the first Datafold CI run for that PR finishes. Later commits to the same PR are not re-reviewed.
2

Changed code is checked against your rules

Datafold analyzes the changed code against your organization’s rule set and removes duplicate findings.
3

Feedback is posted to the PR

Findings are posted as inline review comments, with suggested changes, on the changed lines (up to 20 per pull request).

What AI Code Reviews Check

AI Code Reviews check each pull request against SQL style and best-practice rules that Datafold configures for your organization. For example, a rule set can prefer CTEs over subqueries, or explicit INNER JOIN over comma joins. Contact Datafold support to define your rule set. AI Code Reviews are supported for GitHub and GitLab repositories.

AI Code Reviews + Data Diffs

AI Code Reviews and Data Diffs complement each other: Used together, they provide code-level and data-level validation for each pull request.

Enabling AI Code Reviews

AI Code Reviews require Datafold’s CI integration to be set up with your Git provider and data warehouse. To enable the feature:
  1. Ensure your Git provider and data warehouse are connected in Datafold.
  2. Verify your CI configuration is set up under Settings > Integrations > CI.
  3. Contact Datafold support to enable AI Code Reviews and define your rule set.
Once enabled, AI Code Reviews run automatically after the first CI run for each new pull request — no additional CI pipeline changes are required.

Using Data Diffs Only

If your team prefers to use only Data Diffs without AI Code Reviews, no action is needed. Your existing CI configuration will continue to run Data Diffs as before. AI Code Reviews are an opt-in feature and do not affect Data Diff behavior.