Submission.csv not valid

I am getting this error from a smoke test but can’t find what’s wrong with my output – the structure looks correct when comparing to the sample. Any help would be appreciated!

Process completed successfully. Check the ‘submission.csv’ file for output.

  • echo ‘Exporting submission.csv result…’
    Exporting submission.csv result…
  • ‘[’ -f submission.csv ‘]’
  • echo ‘Script completed its run.’
    Script completed its run.
  • cp submission.csv ./submission/submission.csv
  • exit_code=0
  • cp /code_execution/submission/log.txt /tmp/log
  • exit 0

Hey @galdin-

It looks like your header rows are poorly formatted. The headers on your submission.csv should be:

note_id,start,end,concept_id

Have you run locally to confirm this is the case?

Thank you so much for the clarification. I’m struggling to find the issue though.

From running local, not seeing any extra white space or anything (with fake row data):

note_id,start,end,concept_id
100-DS-9,1,2,387713003
100-DS-9,5,10,91936005

And the exporting script:

            # Collect the results in a list
            output_records.append({
                'note_id': row['note_id'],
                'start': row['start'],
                'end': row['end'],
                'concept_id': concept_id
            })

        # Convert the list of records to a DataFrame
        output_df = pd.DataFrame(output_records)
        
        logging.info("Entities linked to SNOMED codes successfully.")
        
        # Save the DataFrame to a CSV file in the root directory
        output_df.to_csv('submission.csv', index=False)
        logging.info("Results saved to 'submission.csv'.")

I’ll keep looking at it, but any additional insight would be great if you have it.

The only difference I can find is I’m getting CRLF for newline character instead of LF in the sample, but I’d assume that’s because I’m running on Windows locally and the cloud execution would output LF? Otherwise I don’t see anything.

@galdin I think I see the issue now - some of your category labels have a preceding hyphen. Make sure all your category labels are positive integers.