# Mastering Code Reviews: A Guide to Better PRs and Clean SQL
> Learn best practices for data engineering PRs, including naming conventions, dbt documentation, local testing, and etiquette for faster code approvals.

Tags: pull-request, data-engineering, sql-best-practices, dbt, code-review, data-analytics, git-etiquette
## Mastering Code Reviews: Making Reviewers Love You

## The Reviewer's Perspective
* Reviewers feel responsible for production stability and data reliability.
* Ambiguous naming increases cognitive load and causes long-term technical debt.

## Naming Conventions & Model Prefixes
* **stg_**: Staging models
* **prep_**: Preparation models
* **event_**: Curated event data
* Proper folder structures help identify data ownership and granularity.

## Effective Documentation
* Avoid redundant descriptions (e.g., 'It is active' for an 'is_active' field).
* Focus on business logic and specific conditions (e.g., how external profiles are identified).

## Testing & Validation
* **Running Tests Locally**: Use .yml tests (unique, not_null, relationships) as a first line of defense.
* **The 'To Test' Section**: Mandatory in PRs. Should include validation queries, row count comparisons, and proof that business logic matches reality.

## PR Etiquette and Best Practices
* **Communication**: Reply to all comments; don't resolve your own threads (leave it to the reviewer).
* **Consistency**: If a fix is requested in one place, apply it throughout the entire PR.
* **Process**: Post PR links in designated community channels and avoid requesting reviews on Draft PRs.
---
This presentation was created with [Bobr AI](https://bobr.ai) — an AI presentation generator.