The Role of Git in Modern Data Engineering

One of the most useful questions I can ask when a sales number changes is also one of the simplest. What did we change? It sounds like something a data team should be able to answer in a minute. Sometimes it takes half a day. An engineer checks the pipeline. An analyst opens the report. Somebody remembers a conversation about how returns should be handled, but nobody remembers when the decision took effect. Meanwhile, the person who spotted the difference is waiting to find out whether they can trust the number in front of them.

That kind of conversation has shaped how I think about Git. I value the ability to recover an older version of a file, but that is rarely the first reason I reach for it. What I usually need is a reliable account of what changed, why someone believed the change was appropriate, and which part of the reporting process it affected. When a team uses Git well, I can find enough of that story to ask a better second question. That matters when everyone is looking at the same number and bringing a different explanation to the table.

A Small Code Change Can Carry a Big Business Decision

Consider two dates on a sales transaction. One tells you when the transaction occurred. The other tells you when it was posted. Most days they match, so a developer looking at a small sample could reasonably conclude that either field will work. Then a transaction from the last day of June gets posted on the first day of July. Both dates are accurate. Which month gets the sale depends on the question the report is supposed to answer.

In SQL, switching between those fields might take a few seconds. In a monthly business review, it can change whether a location appears to have met its target. This is where I want Git to carry more than the edited line. A commit message like “update sales logic” leaves the next person with almost as much work as they had before. “Use posting date for monthly accounting reconciliation” gives them a basis for evaluation. A short explanation in the pull request can then capture what should happen to the June transaction and whether the daily operations report follows a different rule.

Write the History You Would Want to Read

I try to think about the person who will open a change six months from now. There is a reasonable chance that person will be me, and I have learned to be realistic about how much I will remember. I might remember the meeting where we settled a definition. I am much less likely to remember why we made an exception for one transaction type. If that exception matters enough to put into production, the reasoning deserves a permanent home close to the code.

A useful commit also has a clear scope. If I ask someone to review a change to the howcount returns, I want them to be able to find that immediately. Reformatting an entire query, renaming several columns, and correcting the return logic in a single commit make their job harder. It also makes my job harder if we later discover that the correction needs to be reversed. Keeping related edits together takes a little discipline while the work is fresh. Untangling unrelated edits after a reporting issue takes considerably more.

Use Pull Requests to Review the Numbers

When I review a pull request for a data pipeline, I like to start with a single record and its expected result. Suppose an order has two items and the customer returns one of them. I want the author to tell me what should happen to units and sales dollars, then show me what the revised query produces. That example gives me a way into the code. I can follow the record through the joins and aggregations with a specific question in mind.

This approach also gives analysts a meaningful role in the review. An engineer might immediately spot a join that duplicates rows. An analyst who spends time reconciling sales might notice that the example uses a full price item when the original problem involved a discounted one. Those are different skills, and I want both perspectives on a change that affects a published measure. A pull request gives the team one place to work through the example and preserve the conclusion. It also gives a future reviewer a starting point when a similar question comes up.

Give Experiments a Place to Happen

Some of the best data engineering work starts with a question nobody can answer yet. Maybe a source has started sending a new transaction type. Maybe two systems represent the same business event differently. I want an engineer to have room to try an idea, discover where it falls apart, and try again. A Git branch makes that easier. The engineer can keep the existing logic available for comparison while developing a different approach.

There is an important practical detail here. A branch isolates changes to files. The job on that branch can still write to whatever table its configuration points to. If two versions of a pipeline both write to the same reporting table, the team can interfere with production, even though every Git command behaves exactly as expected. I like pairing development branches with a separate schema or another isolated destination. Then we can run both versions on the same input and compare the results without worrying about which version last wrote to the table.

Connect the Reviewed Code to the Running Job

One of the more frustrating investigations is finding the change that perfectly explains a discrepancy, only to learn that it never reached production. A merge tells me the team accepted a version of the code. I still need to know which version ran on Tuesday morning when the report was produced. In a data environment with scheduled jobs, notebooks, and occasional manual runs, that distinction matters.

Where possible, I want the deployment process to record the Git commit it released and make that identifier available in the job history. That gives me a direct path from a particular run to the code behind it. It also narrows an investigation. If Monday and Tuesday ran the same version, I can turn my attention to source deliveries, configuration, or late transactions. If the version changed, I can inspect the difference before asking three people to reconstruct the release from memory.

Understand What a Revert Actually Fixes

Git can restore earlier logic quickly. Data introduces a complication because the previous logic and the previous state of a table are two different things. Imagine that a pipeline appended duplicate transactions for three mornings before someone caught the problem. Reverting the commit can correct the next run. The duplicate rows from the first three runs are still sitting in the table, and downstream reports may already include them.

This is why I like to discuss recovery while reviewing a significant change. Can we identify the affected records? Can we rerun a date range without double-counting the same transactions? Which summaries need to be refreshed afterward? The answers influence how we design the pipeline in the first place. They also make the conversation with business leaders much clearer. There is a meaningful difference between telling someone the code has been corrected and telling them the published sales figures have been reconciled.

Start Where the Team Already Feels the Pain

If I were introducing Git to a data team today, I would start with a pipeline that regularly generates questions from the business. I would put its current production logic in a repository, establish how changes will reach the running job, and use the next real request to practice the workflow. One engineer could make the change on a branch. A teammate could review a small set of expected results. After release, both could verify that the scheduled run used the version they approved.

The first measure of success would be whether someone outside that conversation could explain the change a month later. Could they find the business reason, identify the affected reports, and see an example of the expected result? That exercise tends to reveal exactly where a team needs more detail and where its process asks people to fill in fields that nobody reads. I have found that people are much more willing to document a decision once they have experienced the relief of finding someone else’s explanation when they need it.

Ultimately, the value of Git shows up for me when I can answer the person who asked about June sales. I can show which transactions moved into July, explain why accounting uses the posting date, and confirm when the revised logic first ran. The person asking may never open the repository or care what a commit is. They care that the explanation makes sense and that the team can stand behind it. That is the role I want Git to play in modern data engineering.


Next
Next

Managing Data Model Versions in a CI/CD World