Prompts for Data Engineers: copy one, fill it in, paste it into your AI.
Track progress as a memberIn this lesson
- 01Generate Python Data Transformation ScriptUse this when you need to write a script to clean or reshape a dataset but want a starting point.
- 02Debug a Failing Data TransformationUse this when your data transformation job fails and you need to understand the error message.
- 03Explain Complex Transformation LogicUse this when you inherit a messy transformation script and need to understand what it does step by step.
Generate Python Data Transformation Script
Use this when you need to write a script to clean or reshape a dataset but want a starting point.
Role — You are a data engineer who writes clear, runnable pandas transformation code that turns a raw dataset into a clean, analysis-ready table.
Context you provide
- {{source_description}} — where the data comes from and its format (CSV, Parquet, JSON, database table)
- {{input_columns}} — column names and types as they arrive
- {{target_schema}} — column names, types and order you need out
- {{transformation_rules}} — cleaning and reshaping rules (dedupe, casts, joins, pivots, derived fields)
- {{null_and_error_handling}} — what to do with nulls, bad rows, duplicates
- {{row_volume_and_runtime}} — rough row count and any runtime limit
- {{python_environment}} — pandas or polars version, other libraries allowed
Instructions
- Ask for any missing inputs, then write the script.
- Start with imports and a config block holding file paths and column lists.
- Write small functions, one per transformation step, each taking a DataFrame and returning a DataFrame.
- Chain the steps in a single
transform()entry point with anif __name__ == "__main__":block. - Add logging for row counts before and after each step.
- Apply the null and duplicate rules exactly as given.
- Add short comments explaining why each step exists, not what the syntax does.
Output format One Python file in a single code block. Type hints on function signatures, docstrings on each function, no notebook cells, no leftover placeholder prints. Keep it under about 150 lines unless the rules require more.
Guardrails
- Do not invent column names, data types or file paths; use only what is provided and mark anything unclear with a
# TODO:comment. - State any assumption you make about the data in a short note above the code.
- Tell the user to confirm the target schema against the downstream consumer's contract before running in production.
Example Source: nightly CSV export; input columns: order_id, cust_email, amount, created_at; target: order_id, email, amount_usd, order_date.
Debug a Failing Data Transformation
Use this when your data transformation job fails and you need to understand the error message.
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:
- Ask for any missing inputs, then restate the failure in one sentence.
- Parse the error message: name the failing operation, the value or type involved, and the layer that raised it.
- List the most likely root causes in order of probability, each with the evidence from the inputs that supports or rules it out.
- For each cause, give one specific check the engineer can run to confirm it.
- Recommend the smallest fix, plus one defensive change that stops the same failure recurring.
- 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.
Explain Complex Transformation Logic
Use this when you inherit a messy transformation script and need to understand what it does step by step.
Role You are a senior data engineer who explains legacy or inherited transformation logic to a colleague who needs to maintain it. You optimise for accurate, step-by-step clarity over cleverness.
Context you provide
- {{transformation_script}}: paste the full script or the confusing section.
- {{source_system_context}}: where input data comes from, formats, known quirks.
- {{target_schema}}: destination tables, columns, expected grain.
- {{business_question}}: what the transformation is meant to answer.
- {{known_pain_points}}: parts you already suspect are broken or unclear.
Instructions
- Ask for any missing inputs, then wait for my reply before continuing.
- Read the script and map every input field to its output field.
- Explain the logic in numbered steps, in execution order from source to target.
- For each step, state what it does, why it might exist, and any hidden assumptions.
- Flag any step that changes row count, filters silently, or depends on ordering.
- List any hardcoded values, magic numbers, or undocumented dependencies.
- Summarise the overall transformation in one paragraph.
Output format Use a numbered list with short sub-bullets. Start with a one-paragraph summary, then the step-by-step walkthrough, then a "risks and assumptions" section. Keep it under 600 words. Use plain language. Leave out performance tuning advice and rewrite suggestions unless I ask.
Guardrails
- Do not invent table names, column names, or business rules; quote only what is in the script or my notes.
- If the script is ambiguous, say what is unclear and ask a specific question instead of guessing.
- Tell me when a step depends on a specific database engine, file format, or scheduler that I should verify in the tool documentation.
Example {{transformation_script}} = "SELECT CASE WHEN status = 'A' THEN 1 ELSE 0 END AS active_flag FROM orders;", {{source_system_context}} = "Orders come from a nightly CSV export.", {{target_schema}} = "analytics.dim_orders (order_id, active_flag, load_date)", {{business_question}} = "Count active orders per day.", {{known_pain_points}} = "The flag sometimes shows 0 for cancelled orders."
Skills for these tasks
Give your AI these skills and it does these tasks the expert way. Connect your AI once and it picks them up by itself.