Made byBobr AI

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.

#pull-request#data-engineering#sql-best-practices#dbt#code-review#data-analytics#git-etiquette
Watch
Pitch

How to Make Reviewers Approve Your PR

A Guide to Clean SQL, Happy AEs, and Fewer Headaches By Miriam Revilla Alvarez

Success Kid meme high quality
Made byBobr AI
The Game Plan
1. The Reviewer's Perspective (Why we are like this)
2. Follow Best Practices (Naming & Folders)
3. Documentation (No creative writing)
4. Testing & The 'To Test' Section
5. Etiquette 101
6. Kahoot! Deathmatch
Isometric 3D map illustration showing a path from mess to clean data, clean vector art
Made byBobr AI

The Reviewer's Perspective 🧐

Why are we strict?

We feel responsible for Production. Broken logic = 3AM wake-up calls.

Ambiguous names (e.g., 'id') cause cognitive load and bugs 6 months later.

We want you to succeed, but we need to protect the data reliability.

This is fine dog meme
Made byBobr AI

Naming Conventions & Folders

The Rules
Model Prefixes (Non-negotiable):
stg_ : Staging models
prep_ : Prep models
event_ : Curated event data

Why?
Instantly tells the user the granularity and type of data.
computer folder structure diagram simple flat design
Example: hub_shifts.sql lives under central_ops_team / staffing / shifts / curated.
Start clean, stay clean.
Made byBobr AI

Documentation: Not a Creative Writing Class

Bad:
{% docs is_active %}
It is active.
{% enddocs %}

Reviewer Reaction: Thanks, I can read.
Good:
{% docs is_external_last_mile_rider_profile %}
TRUE if external_agency_name is not empty. Used to identify contracted riders.
{% enddocs %}

Reviewer Reaction: 🤩 Clarity!
Meme of someone squinting at a small paper or confusion
Made byBobr AI

🧪 Testing: The Bare Minimum

1. Run Tests Locally (Always)
.yml tests are your first defense.
unique, not_null, relationships.

2. Why?
If these fail, we waste time iterating on typos. Don't be that person.
Disaster Girl meme house fire
Made byBobr AI

The 'To Test' Section is Mandatory

Passing .yml tests matches syntax.
'To Test' matches REALITY.

Include:
✅ Confirmation .yml tests passed
🧠 Validation queries (Show intent!)
📊 Row count comparisons
⚠️ Explicit callouts for weird data
screenshot of a github PR description with a checklist checked
Made byBobr AI

Validate Business Logic (Show us the Data!)

Don't just run the code. Prove the result makes sense.
Ex: A process change should reduce tickets. Show the drop!

Chart
Made byBobr AI

🤩 How to Keep Your Reviewer Happy

bullet_1: Reply to comments
Don't ghost us. Explain your fix or argue your case (politely).

bullet_2: Don't resolve your own threads
That's the reviewer's job. It helps us track what is still pending.

bullet_3: Fix it everywhere
If we comment on line 10, check if line 50 has the same issue.
Happy high five office colleagues illustration flat style
Made byBobr AI

🎓 Be a Great PR Citizen

1. Post in #data-analytics-community when ready.
2. Fill in 'What's the problem' and 'dbt statements'.
3. No 'Draft' PRs for review (Wait until you are done!).
4. Re-request review ONLY when you are actually done fixing things.
Skeleton waiting on bench meme
Made byBobr AI

IT'S KAHOOT TIME! 📱

Q1: Which folder implies ownership?
(A: The closest one to dependencies)

Q2: Who resolves PR comments?
(A: The Reviewer only)

Q3: What prefix is used for curated Event data?
(A: event_)

Q4: Is the 'To Test' section optional?
(A: No, never.)

Q5: Where do you post your PR link?
(A: #data-analytics-community)
A generic QR code illustration
Made byBobr AI
Bobr AI

DESIGNER-MADE
PRESENTATION,
GENERATED FROM
YOUR PROMPT

Create your own professional slide deck with real images, data charts, and unique design in under a minute.

Generate For Free

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.

How to Make Reviewers Approve Your PR

A Guide to Clean SQL, Happy AEs, and Fewer Headaches By Miriam Revilla Alvarez

The Game Plan

1. The Reviewer's Perspective (Why we are like this) <br> 2. Follow Best Practices (Naming & Folders) <br> 3. Documentation (No creative writing) <br> 4. Testing & The 'To Test' Section <br> 5. Etiquette 101 <br> 6. Kahoot! Deathmatch

The Reviewer's Perspective 🧐

Why are we strict?

We feel responsible for Production. Broken logic = 3AM wake-up calls. <br><br> Ambiguous names (e.g., 'id') cause cognitive load and bugs 6 months later. <br><br> We want you to succeed, but we need to protect the data reliability.

Naming Conventions & Folders

<strong>Model Prefixes (Non-negotiable):</strong><br>• <code>stg_</code> : Staging models<br>• <code>prep_</code> : Prep models<br>• <code>event_</code> : Curated event data<br><br><strong>Why?</strong><br>Instantly tells the user the granularity and type of data.

Example: hub_shifts.sql lives under central_ops_team / staffing / shifts / curated. <br>Start clean, stay clean.

Documentation: Not a Creative Writing Class

❌ <strong>Bad:</strong><br>{% docs is_active %}<br>It is active.<br>{% enddocs %}<br><br><em>Reviewer Reaction: Thanks, I can read.</em>

✅ <strong>Good:</strong><br>{% docs is_external_last_mile_rider_profile %}<br>TRUE if external_agency_name is not empty. Used to identify contracted riders.<br>{% enddocs %}<br><br><em>Reviewer Reaction: 🤩 Clarity!</em>

🧪 Testing: The Bare Minimum

<strong>1. Run Tests Locally (Always)</strong><br>.yml tests are your first defense. <br>unique, not_null, relationships.<br><br><strong>2. Why?</strong><br>If these fail, we waste time iterating on typos. Don't be that person.

The 'To Test' Section is Mandatory

Passing .yml tests matches syntax. <br><strong>'To Test' matches REALITY.</strong><br><br>Include:<br>✅ Confirmation .yml tests passed<br>🧠 Validation queries (Show intent!)<br>📊 Row count comparisons<br>⚠️ Explicit callouts for weird data

Validate Business Logic (Show us the Data!)

Don't just run the code. Prove the result makes sense. <br>Ex: A process change should reduce tickets. Show the drop!

🤩 How to Keep Your Reviewer Happy

bullet_1: <strong>Reply to comments</strong><br>Don't ghost us. Explain your fix or argue your case (politely).<br><br>bullet_2: <strong>Don't resolve your own threads</strong><br>That's the reviewer's job. It helps us track what is still pending.<br><br>bullet_3: <strong>Fix it everywhere</strong><br>If we comment on line 10, check if line 50 has the same issue.

🎓 Be a Great PR Citizen

1. Post in <strong>#data-analytics-community</strong> when ready.<br>2. Fill in <em>'What's the problem'</em> and <em>'dbt statements'</em>.<br>3. No 'Draft' PRs for review (Wait until you are done!).<br>4. Re-request review ONLY when you are actually done fixing things.

IT'S KAHOOT TIME! 📱

<strong>Q1:</strong> Which folder implies ownership? <br><em>(A: The closest one to dependencies)</em><br><br><strong>Q2:</strong> Who resolves PR comments? <br><em>(A: The Reviewer only)</em><br><br><strong>Q3:</strong> What prefix is used for curated Event data? <br><em>(A: event_)</em><br><br><strong>Q4:</strong> Is the 'To Test' section optional? <br><em>(A: No, never.)</em><br><br><strong>Q5:</strong> Where do you post your PR link? <br><em>(A: #data-analytics-community)</em>

  • pull-request
  • data-engineering
  • sql-best-practices
  • dbt
  • code-review
  • data-analytics
  • git-etiquette