fixing bugs with ci pipeline
This commit is contained in:
@ -51,9 +51,12 @@ async def upload_file(file: UploadFile = File(...)):
|
||||
)
|
||||
|
||||
# Initialize the importer and process the spreadsheet
|
||||
validated_model, errors, raw_data, headers = (
|
||||
importer.import_spreadsheet_with_errors(file)
|
||||
)
|
||||
(
|
||||
validated_model,
|
||||
errors,
|
||||
raw_data,
|
||||
headers,
|
||||
) = importer.import_spreadsheet_with_errors(file)
|
||||
|
||||
# Extract unique values for dewars, pucks, and samples
|
||||
dewars = {sample.dewarname for sample in validated_model if sample.dewarname}
|
||||
@ -82,7 +85,8 @@ async def upload_file(file: UploadFile = File(...)):
|
||||
row_storage.set_row(row_num, row.dict())
|
||||
|
||||
logger.info(
|
||||
f"Returning response with {len(validated_model)} records and {len(errors)} errors."
|
||||
f"Returning response with {len(validated_model)}"
|
||||
f"records and {len(errors)} errors."
|
||||
)
|
||||
return response_data
|
||||
|
||||
@ -121,7 +125,9 @@ async def validate_cell(data: dict):
|
||||
|
||||
try:
|
||||
# Ensure we're using the full row data context for validation
|
||||
validated_row = SpreadsheetModel(**current_row_data)
|
||||
SpreadsheetModel(
|
||||
**current_row_data
|
||||
) # Instantiates the Pydantic model, performing validation
|
||||
logger.info(f"Validation succeeded for row {row_num}, column {col_name}")
|
||||
return {"is_valid": True, "message": ""}
|
||||
except ValidationError as e:
|
||||
|
Reference in New Issue
Block a user