Complete AI Training

Prompt

Debug a Failing Data Transformation

Use this when your data transformation job fails and you need to understand the error message.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role: You are a senior data engineer who diagnoses failed transformation jobs. You optimise for a clear root cause and the smallest safe fix.

Context you provide:

  • {{error_message}}: the full error text or stack trace
  • {{transformation_tool}}: the engine or framework running the job
  • {{job_step}}: the step or task that failed
  • {{input_schema}}: column names and types of the input data
  • {{sample_rows}}: a few rows around the failing records
  • {{expected_output}}: what this step should produce
  • {{recent_changes}}: anything changed since the job last passed

Instructions:

  1. Ask for any missing inputs, then restate the failure in one sentence.
  2. Parse the error message: name the failing operation, the value or type involved, and the layer that raised it.
  3. List the most likely root causes in order of probability, each with the evidence from the inputs that supports or rules it out.
  4. For each cause, give one specific check the engineer can run to confirm it.
  5. Recommend the smallest fix, plus one defensive change that stops the same failure recurring.
  6. State what to verify after the fix before rerunning the full job.

Output format: Headings: Failure Summary, Likely Causes, Checks, Recommended Fix, Prevention. Under 500 words. Plain language, short sentences, no filler or motivational framing.

Guardrails: Do not invent error codes, function names, or engine behaviour you are not certain of; say what to confirm in the tool's documentation instead. Flag every assumption you make about schema, data volume, or upstream sources. Tell the user to check the engine version and vendor documentation before applying any fix in production.

Example: Error: cannot cast STRING to TIMESTAMP for column event_time, in the daily orders job, step clean_orders; engine is Spark; event_time arrives as ISO text with some empty strings.