Skip to content

Bug: support_tickets.csv is malformed, row 7 contains an embedded newline that causes the parser to drop a ticket #28

Description

@ayaan-there

Description

The provided input file support_tickets/support_tickets.csv contains a malformed row that causes standard CSV parsers (Python csv module, pandas) to produce 29 rows instead of 30.

Root cause

Row 7's Issue field contains a trailing \n inside the quoted value:

"i can not able to see apply tab\n"

Per RFC 4180, a newline inside a quoted field is treated as part of the field value, not a record separator. As a result:

  • Row 7's Issue is parsed as "i can not able to see apply tab\n" (with trailing newline)
  • The next physical line, the Issue of ticket 8 ("I need to practice, submissions not working") is absorbed as row 7's Subject
  • Ticket 8 is silently dropped
  • All rows from index 8 onward are shifted by one field

Impact

Any solution that reads the CSV with a standard parser and outputs 30 rows is being penalised for non-compliance, when the compliant behaviour (correct RFC 4180 parsing) is what produces the 29-row result. Conversely, solutions that produce 30 rows either detect and repair the defect, or are applying workarounds that the challenge did not document as necessary.

Reproduction

import pandas as pd
df = pd.read_csv('support_tickets/support_tickets.csv')
print(len(df))  # prints 29, not 30
print(df.iloc[6])  # Subject column contains ticket 8's issue text

Suggested fix

Replace the malformed row in the CSV so that the Issue field does not contain an embedded newline. A corrected version of row 7 should be:

"i can not able to see apply tab","<original subject>","HackerRank"

Alternatively, document that participants are expected to detect and repair this defect as part of the challenge, and clarify whether the expected output is 29 or 30 rows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions