Skip to content

Stage 3 · Role applications

Build and verify a CSV converter with a coding assistant

Start with expected rows for zero and blank. Run a small Python converter against old, new and malformed inventory files.

3 units · 3 lessons · 64 min read

Two input tables pass through a validation window to a single output table
Illustration: Two input tables pass through a validation window to a single output table · AI Ping

Step-by-step curriculum

Read the approach for each unit, then choose a lesson. Skip anything familiar.

  1. Brief a coding assistant

    Identify the input and expected behaviour that make a code change reviewable.

    Getting good results from AI coding assistants

    Up next

    20 min
  2. Specify a single row

    Find a default that invents zero and retest on unseen rows.

    Teach a coding assistant the difference between zero stock and a blank

    22 min
  3. Change the file format

    Separate header contracts and verify that rejected files emit no partial result.

    Adapt AI-written imports when a supplier changes its CSV format

    22 min

Practice on fresh material

Predict the contents and exit state of a new stock feed

The source records and draft are editorial examples. Read each question, then open the worked answer to compare.

Source material

  • v1: item,count / Q5,000 / Q6,two spaces
  • v2: available_qty,item / 8,R1 / -2,R2. Separate mixed file: item,count,available_qty / R3,7,0.
  1. 1. Brief the assistant

    Ask the assistant to predict row order, hold reasons and the output state of a rejected file.

    See a sample request

    Return expected item,qty,status and success or failure per file. Distinguish zero, whitespace and negative values. Reject the mixed header as a whole.

  2. 2. Check and repair the draft

    Verify “Q6 is zero and R3 uses the new zero value.”

    See the correction and reasoning

    v1 gives Q5,0,ok and Q6,,hold:missing. v2 gives R1,8,ok and R2,,hold:invalid. The mixed file exits 2 with no stdout; its plausible-looking R3 never passes header validation.

  3. 3. Apply the method to a change

    The supplier resends item,available_qty followed by R3,0. Can you reuse the old rejection?

    Check the revised result

    Rerun the corrected file as v2. It passes and produces R3,0,ok. Keep the previous rejection tied to the earlier input.

Before moving on

Predict accepted rows, held rows and rejected files, then identify the first unexpected result.

Revisit the explanation →

Review what you have learned

Use the worked examples and explanations to describe how AI supports each step below. Running an external tool is optional.

Forecast the output for an unfamiliar stock feed and the exit condition for a conflicting header.

  • Distinguish an observed zero from missing data.
  • Check whether a rejected file emitted any output.

Explore the next series