Skip to content

Commit da9fea0

Browse files
committed
Add fn to create csv
1 parent 9510ad8 commit da9fea0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

dev/dags/sample.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from datetime import datetime, timedelta
23
from random import randint
34
from typing import Any
@@ -62,3 +63,10 @@ def read_params(params: dict[str, Any]) -> None:
6263

6364
def generate_data():
6465
print("Produced data to file:///$AIRFLOW_HONE/data.csv")
66+
data_dir = os.environ.get("AIRFLOW_HONE", "/usr/local/airflow")
67+
file_path = os.path.join(data_dir, "data.csv")
68+
69+
with open(file_path, "w") as f:
70+
f.write("id,value\n1,42\n2,43\n")
71+
72+
print(f"Produced data to file://{file_path}")

0 commit comments

Comments
 (0)