Production Python for Data Engineers

Setting Up Your AI Coding Assistant

Why we're doing this

Here's something worth being honest about, right at the start: you are almost certainly going to use an AI coding assistant, in this course and in your job. That's not really a choice anymore. The real question is — will you use it in a way that makes you a better engineer, or a way that quietly makes you a worse one?

Think about the two ways people typically use AI to write code.

The first way — let's call it vibe coding. You type a prompt. The AI gives you code. You paste it in. You run it. If nothing obviously explodes, you move on. It feels fast. It also means bugs can slip straight into your codebase, sit there quietly, and cause real damage weeks later — because nobody, human or AI, ever actually confirmed the code did what it was supposed to do.

The second way — the closed loop. This is what this entire course is built around, and it looks different:

  1. You ask the AI to do something specific.
  2. It proposes a plan, or writes code.
  3. You run it, for real. You look at actual output. If there's a test, you watch it pass or fail with your own eyes.
  4. You read the change the way you'd review a teammate's pull request — carefully, not as a formality.
  5. You iterate based on what actually happened, not on how confident the AI sounded while explaining itself.

Notice the difference. In the closed loop, you never accept code just because it "looks right." You accept it because you watched it prove itself. Every AI-assisted exercise in this course follows this pattern, without exception — so it's worth building the habit now, before it matters for real.

That's what this document sets you up for: getting a real AI coding assistant working inside VS Code, one that can actually run code and show you real results — not just talk about what it would do.

Two paths, and why both are here

There are two solid options for this course, and — good news — one of them costs nothing.

GitHub CopilotClaude Code
CostFree, forever (with monthly limits)No free tier for actual coding — minimum $20/month (Pro plan), or pay-per-use API credits
Where it livesBuilt directly into VS CodeA separate CLI, plus a VS Code extension that wraps it
Good enough for this course?Yes — the free tier includes agent mode, which is what the closed loop needsYes, and arguably an even closer match to how we describe the closed loop

Here's the honest recommendation: start with Copilot's free tier. It costs nothing, it lives right inside VS Code, and it genuinely supports agent mode — meaning it can run commands, see the results, and iterate, which is exactly what this course needs. If you later decide you want to try Claude Code as well — plenty of learners will, since it's a strong tool and worth knowing — Part B below walks you through it. But nobody should feel blocked from this course by a $20/month tool. Free is a completely legitimate way to do every AI-assisted round in this course.

This course stays tool-agnostic. Pick one, or try both. What matters is the discipline — the closed loop — not the logo on the extension.

You can install and use both, side by side. They don't conflict — Copilot lives inside VS Code itself, and Claude Code is a separate CLI plus its own extension. Installing one doesn't disable or interfere with the other. It's completely reasonable to use Copilot for most modules and switch to Claude Code for a module or two just to compare — each shows up as its own panel or entry point in VS Code, so there's no risk of mixing them up mid-task.


Part A: GitHub Copilot (free)

A1. Make sure VS Code is current

Copilot's chat and agent features are tied closely to the VS Code release itself — an old VS Code build can leave you stuck on an old, weaker version of Copilot Chat without you realizing it. Open VS Code, and check for updates: Help → Check for Updates (or just reinstall the latest version from code.visualstudio.com if you're not sure).

A2. Sign in

AI features are built directly into VS Code now — you don't need to install a separate extension for the basics. Just sign in:

  1. Look at the VS Code title bar (or the status bar at the bottom) for a Sign In option, or hover over the Copilot icon in the status bar and choose Enable AI features.
  2. Sign in with your GitHub account. If you don't have one, create a free account at github.com first.
  3. If you don't already have a Copilot subscription, you're automatically placed on the free plan — no separate signup needed, no credit card required.

A3. Confirm agent mode is available to you

  1. Open the chat panel: Ctrl+Alt+I (Windows/Linux) or ⌃⌘I (Mac).
  2. Look at the bottom of the chat panel, just above the message box. You're looking for a small row of controls that looks something like:
    [+]  [Agent ⌄]  [Auto]  [sliders icon]
    
    (Exactly how this looks can shift slightly between VS Code releases — if it doesn't match exactly, look for whatever control lets you choose between "Ask," "Edit," and "Agent" modes; it may appear as a dropdown at the top of the panel instead, depending on your version.)
  3. Make sure Agent is selected, not "Ask" or "Auto." This is the mode that can actually read your files, propose multi-step changes, run terminal commands, and check its own results — the mode this course actually needs, not just autocomplete.
  4. You'll also see "Local" and "Default approvals" near the bottom of the panel. Leave both on their defaults for now — "Default approvals" means Copilot will pause and ask your permission before running a command or changing a file, which is exactly what you want while you're still learning to review its proposals. You'll see this show up as Allow / Skip buttons whenever it wants to do something — the demo below walks through exactly what that looks like.

A4. Know your limits going in

The free plan is real, but it's not unlimited: roughly 50 agent/chat requests and 2,000 code completions per month, at the time this guide was written. For a course working through one module at a time, this is normally plenty — but if you find yourself burning through the monthly allowance fast, that's a sign to either pace your AI-assisted rounds more deliberately, or consider a paid tier later. It is not a sign that something is broken.


Part B: Claude Code (optional, paid)

Skip this part entirely if you're happy with Copilot's free tier — it's a completely valid choice for this whole course. Come back to this section later if you decide you want to try Claude Code as well.

B1. Check whether Node.js is installed

Claude Code installs via npm, so you need Node.js first. In your Ubuntu (or Mac) terminal:

bash
node --version npm --version

If both print version numbers, skip to B2. If either says "command not found":

bash
sudo apt update sudo apt install -y nodejs npm

(Same Linux password from setup, if it asks. Mac users: brew install node if you have Homebrew, or download an installer from nodejs.org.)

B2. Install the Claude Code CLI

bash
npm install -g @anthropic-ai/claude-code

If this fails with a permission error, don't run it with sudo — that creates a different set of problems later. Instead, point npm at a folder you actually own, and make sure the fix survives a restart:

bash
mkdir -p ~/.npm-global npm config set prefix ~/.npm-global echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc source ~/.bashrc

That last two lines matter more than they look — a plain export PATH=... only applies to the terminal window you typed it in. The moment you close that window, restart VS Code, or open a new terminal, it's gone, and claude will suddenly say "command not found" again even though nothing actually broke. Writing it into ~/.bashrc makes it permanent, so every new terminal picks it up automatically from now on.

Then re-run the install command.

B3. Confirm it installed correctly

bash
claude --version

You should see a version number like claude-code 1.x.x.

B4. Install the VS Code extension

  1. In VS Code, open the Extensions panel: Ctrl+Shift+X (or Cmd+Shift+X on Mac).
  2. Search for "Claude Code" and install the official extension by Anthropic.
  3. You should now see a Claude Code icon in the left sidebar.

B5. Authenticate

  1. Open your project folder in VS Code.
  2. Open the integrated terminal (Ctrl+** or **Cmd+) and run:
    bash
    claude
  3. The first time you run this, it'll walk you through signing in with your Anthropic account. This requires at minimum a Pro plan ($20/month) — the free Claude chat plan does not include Claude Code. If you'd rather pay only for what you use, you can authenticate with an API key instead and pay per token — worth knowing about, but Pro is simpler for most learners.
  4. Once signed in, you can also connect the extension explicitly to make sure it's talking to your open editor:
    bash
    claude --ide

B6. Confirm it's working

With your project folder open in VS Code, either:

  • Click the Claude Code icon in the sidebar, or
  • Run claude in the integrated terminal

Either way, you should get an interactive prompt where you can start giving it instructions, and see a diff view when it proposes changes to your files.


Try the closed loop yourself

Don't save your first real AI-assisted experience for the middle of a graded module. Try it now, on something small and throwaway, so the rhythm of the closed loop is already in your hands before it matters.

The task, either way: ask your assistant to write a small function that checks whether a string looks like a valid email address (a reasonable approximation, not a full RFC-compliant parser), plus a test for it.

If you set up both tools in Parts A and B, do the demo twice — once with Copilot, once with Claude Code. The task is identical on purpose. What you're comparing isn't which tool is "better" — it's how the same closed-loop discipline looks slightly different depending on the interface.

Demo 1: GitHub Copilot

Step 1 — Give this demo its own folder, and open it. Use a fresh, empty folder for this — not your pp4de project. You're about to ask your assistant to create a function and a test file, and if you reuse the same folder for both demos later, the second one will trip over the first one's leftover files. A clean folder keeps things simple:

bash
mkdir -p ~/ai-assistant-demo/demo-copilot code ~/ai-assistant-demo/demo-copilot

Once VS Code opens onto this folder, open the chat panel (Ctrl+Alt+I), and confirm Agent mode is selected, as described in Part A3.

Step 2 — Use this exact prompt:

Output / Note

"Write a Python function is_valid_email(s: str) -> bool that returns True for a reasonably well-formed email address and False otherwise. Include a pytest test file with at least 5 cases, including obviously invalid ones. Run the tests and show me the result before we're done."

Step 3 — Expect confirmation prompts, and read them before clicking. With "Default approvals" on, Agent mode pauses before running commands or changing files, and shows Allow / Skip buttons. Read what it's asking to run. Installing a well-known package or running a test file is normal and safe to Allow. A generic caution icon may appear next to any pip install — that's a blanket VS Code warning for all package installs, not a specific flag on this one.

Step 4 — Don't be surprised if the first attempt hits a snag. Two things commonly happen on a fresh environment, and both are genuinely useful to watch rather than something to worry about:

  • pytest isn't installed yet, so the first test run fails with "command not found." A capable assistant notices this and proposes installing it — allow that, and let it retry.
  • Even after pytest is installed, you may see a ModuleNotFoundError when the test tries to import your function. This is a common Python quirk — running bare pytest doesn't always add your current folder to the import path the way you'd expect. Watch what the assistant proposes before accepting: a capable one investigates first (for example, checking sys.path) rather than guessing at a fix. One common fix is a small sys.path adjustment added to the top of the test file. That's a reasonable patch for this throwaway demo — though it's also a small, live preview of exactly the packaging fragility Module 1 teaches you to solve properly instead of patching around.

If you hit either of these, that's the closed loop working exactly as intended — the assistant hit a real wall and adapted, instead of just claiming success. Keep clicking Allow on each proposed step, and keep reading what it's actually doing.

Step 5 — Check the real terminal output yourself. Once it reports success, scroll up in the integrated terminal and find the actual pytest result line — something like 10 passed in 0.01s. Don't just trust the chat panel's summary of what happened.

Step 6 — Read the diff like a pull request. Open the actual function file it wrote and read it yourself. Do you understand why it works, or did you just watch a checkmark appear? Would you accept this from a teammate, or leave a comment?

Step 7 — Try to break it on purpose, even after it says all tests pass. What about "not-an-email"? An empty string? Something with two @ symbols, or a trailing dot? Ask directly whether the existing test cases cover these. If not, ask it to add a case and fix the function if it fails.

Step 8 — Don't accept extra scope just because it's offered. It's common for an assistant to end a successful run with something like "I can also improve this further — want me to?" Deciding whether you actually want that is your call, not something to accept by default because it was suggested.

Demo 2: Claude Code

Same task, same prompt — this time through Claude Code's interface instead of Copilot's side panel.

Step 1 — Give this demo its own folder too, separate from Demo 1. Same reasoning as before — a clean folder means nothing from the Copilot demo gets in the way here:

bash
mkdir -p ~/ai-assistant-demo/demo-claude-code cd ~/ai-assistant-demo/demo-claude-code claude

Or click the Claude Code icon in the VS Code sidebar if you'd rather use the extension view. Either way, you should land in an interactive prompt.

Step 2 — Use the same exact prompt as Demo 1:

Output / Note

"Write a Python function is_valid_email(s: str) -> bool that returns True for a reasonably well-formed email address and False otherwise. Include a pytest test file with at least 5 cases, including obviously invalid ones. Run the tests and show me the result before we're done."

Step 3 — Expect a similar permission flow, in terminal form. Claude Code asks before running commands too — instead of Allow/Skip buttons in a side panel, you'll typically see a prompt directly in the terminal asking whether to proceed with a specific command (for example, running pip install pytest or executing the test file). Read the command it's about to run before approving it, exactly as you did with Copilot.

Step 4 — Watch for the same kind of real-world snags. If pytest isn't installed, or the test hits an import error, Claude Code should notice from the actual command output and propose a fix — not just assume success. If you already ran Demo 1, you may not hit these again (pytest is likely installed now), which is a fine outcome too — it just means this run goes more smoothly, not that the loop somehow matters less.

Step 5 — Confirm real output, not a summary. Look at the actual terminal text for the test run — a line like 5 passed or 10 passed. Claude Code's interface tends to show command output directly and prominently, but the habit is the same: read the real result yourself.

Step 6 — Read the diff. Claude Code shows you a diff view before changes are applied. Read it the same way as Step 6 in Demo 1 — as a pull request, not a formality.

Step 7 — Try to break it on purpose. Same as Demo 1 — ask about edge cases the tests might have missed, and see whether it catches and fixes anything.

Step 8 — Notice what felt the same, and what felt different. The underlying discipline — propose, run, verify, review, iterate — should feel identical between the two tools. The interface around it is what changes: a chat side-panel with Allow/Skip buttons versus a terminal session with inline prompts. That's the whole point of doing this twice — proving to yourself that the closed loop is a habit you carry between tools, not something tied to one specific product.


You don't need to save or commit anything from either demo. It's just muscle memory before the real thing — every AI-assisted round from Module 1 onward follows exactly this same shape, just with real capstone code instead of a throwaway email checker. Once you're done with both, feel free to delete the whole thing:

bash
rm -rf ~/ai-assistant-demo

Verification checklist

  • VS Code is signed in and shows either Copilot or Claude Code (or both) as available
  • Agent mode (Copilot) or a working claude session (Claude Code) can actually run a command and show you real output — not just generate a code block
  • You've completed the email-validator demo at least once, and walked through all the steps of the closed loop — not just pasted a prompt and accepted the first result
  • If you set up both tools, you've run the demo with each at least once, and noticed how the interaction style differs while the underlying discipline stays the same
  • You know your monthly limits (Copilot free tier) or your billing setup (Claude Code), so a usage cap doesn't surprise you mid-module

Troubleshooting

Copilot: no "Agent" option in the chat mode dropdown Your VS Code build is likely out of date — agent mode support ships alongside specific VS Code releases. Update VS Code (Help → Check for Updates) and reopen the chat panel.

Copilot: "you've reached your monthly limit" This means exactly what it says — you're on the free tier and used your allotted agent/chat requests for the month. It resets monthly. In the meantime, you can still do the module manually and revisit the AI-assisted round once your limit resets, or consider a paid tier if this becomes a recurring blocker.

During the demo: pytest says "command not found" Expected on a fresh environment — pytest isn't installed by default. A capable assistant should notice this itself and propose installing it. Allow that step, and let it retry the test run.

During the demo: ModuleNotFoundError when the test tries to import your function Also expected, and not a sign anything is broken. Running bare pytest doesn't always add your current folder to Python's import path. Watch what your assistant proposes to fix it — a small sys.path adjustment at the top of the test file is a common, reasonable fix for this throwaway demo. (If you're curious why this happens, or want to understand exactly what that fix does, ask your assistant to explain the specific line it added — that's a good habit to build now, not just for this demo.)

Claude Code: npm install -g fails with permission errors Don't reach for sudo — see step B2 above for the proper fix (pointing npm at a directory you own, with the PATH change made permanent in ~/.bashrc).

Claude Code: worked fine earlier, but now the terminal says claude: command not found This almost always means the PATH fix from B2 was only applied to one terminal session — for example with a plain export PATH=... that never got saved into ~/.bashrc — and a restart of VS Code or your terminal lost it. Confirm with:

bash
npm config get prefix echo $PATH

If the prefix path isn't showing up in $PATH, re-run the permanent fix from B2:

bash
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc source ~/.bashrc

Claude Code: claude --ide doesn't connect / no diff view appears Restart VS Code completely — not just a window reload. Confirm the Claude Code extension shows as enabled in the Extensions panel (no "Disable" button visible means it's already on), then run claude --ide again. Also confirm your CLI is reasonably current with claude --version.

Claude Code: asked to sign in, but you only have the free Claude chat plan That's expected — the free Claude plan covers chat only, not the Claude Code terminal/agent tool. You'll need at least a Pro subscription ($20/month) or API credits to use Claude Code specifically. If that's not something you want to pay for, Copilot's free tier remains a fully valid path through this entire course — you're not missing anything required.

Neither tool seems to be actually running commands — it just talks about what it would do Double-check you're in the right mode: Copilot's "Ask" and "Edit" modes don't run terminal commands the way "Agent" mode does. Make sure Agent mode is explicitly selected, not just Chat. For Claude Code, make sure you're in an active claude session in the terminal, not just reading about it.