#6137·mage-ai

Titanic example pipeline writes output CSV outside the Mage project folder

Author: BobbyWang0120Created Jun 29, 2026Updated Jul 8, 2026

Problem

The built-in Titanic example pipeline exporter writes its output with a bare relative filename:

python
filepath = 'titanic_clean.csv'
FileIO().export(df, filepath)

When Mage is started from the repository root, this creates titanic_clean.csv at the root of the Mage checkout instead of inside the generated Mage project.

Expected behavior

The example pipeline should write generated data under the Mage project folder, for example:

data/processed/titanic/titanic_clean.csv

This keeps tutorial output grouped with the project data and avoids surprising files in the application/repository root.

Proposed fix

Update the built-in template exporter at:

mage_ai/data_preparation/templates/repo/data_exporters/export_titanic_clean.py

to resolve the generated project root from __file__, create a processed Titanic output directory, and write the cleaned CSV there.