Spaces:
Build error
Build error
Update data_ingestion
Browse files- data_ingestion +9 -0
data_ingestion
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def data_ingestion(data_file):
|
| 2 |
+
try:
|
| 3 |
+
df = pd.read_csv(data_file) # This works better with Hugging Face file-like objects
|
| 4 |
+
data_pipelines["data_ingestion"] = df
|
| 5 |
+
log_event("Data ingestion completed successfully.")
|
| 6 |
+
return df.head()
|
| 7 |
+
except Exception as e:
|
| 8 |
+
log_event(f"Data ingestion failed: {str(e)}")
|
| 9 |
+
return f"Error: {str(e)}"
|