File upload issue

This commit is contained in:
CHIEFSOFT\ameye
2025-05-10 08:34:59 -04:00
parent 420ff8e26c
commit 5e5459450b
2 changed files with 11 additions and 3 deletions
+3
View File
@@ -12,4 +12,7 @@ output/models/inconsistent_scaler.joblib
.env .env
__pycache__ __pycache__
__pycache__/* __pycache__/*
output/*
.idea/*
+7 -2
View File
@@ -298,8 +298,11 @@ async def get_file_if_csv(source: str, file: Optional[UploadFile] = File(None)):
async def run_streaming_pipeline( async def run_streaming_pipeline(
source: str = "db", source: str = "db",
batch_size: int = 10000, batch_size: int = 10000,
file: Optional[UploadFile] = Depends(get_file_if_csv) UploadFile: str=''):
):
file = None
if len(UploadFile) > 0 :
file : Optional[UploadFile] = Depends(get_file_if_csv)
""" """
Run the complete salary analytics pipeline in batches. Run the complete salary analytics pipeline in batches.
@@ -327,6 +330,8 @@ async def run_streaming_pipeline(
responses = [] responses = []
batch_number = 0 batch_number = 0
print("Sal************************", source)
def preprocess_chunk(chunk): def preprocess_chunk(chunk):
"""Preprocess a chunk of data with the same logic as DataLoader.""" """Preprocess a chunk of data with the same logic as DataLoader."""
# Convert dates # Convert dates