[Python] Found character '-' instead of field delimiter ','

Discussão em 'Python' iniciado por Stack, Outubro 6, 2024.

  1. Stack

    Stack Membro Participativo

    I'm pulling data from Postgresql into Snowflake. One of the fields contains gift messages customers can put in. One of the entries are giving me the error in the title. The gift message is the following (with redacted info), all spacing and capitalization are retained:

    "a quote from a movie" - character's name

    Message! More message. +/- 10 Days AWAY! - name1, name2, name3 and NAME4


    There is a whitespace after "character's name", and the paragraphs are separated by an empty line. There are other multi-line messages in the past and I never ran into this issue. I'm using this panda function to process the data into csv files for staging on S3:

    df.to_csv(
    fp.name,
    index=False,
    quotechar="",
    doublequote="",
    quoting=csv.QUOTE_NONE,
    escapechar=self.escapechar,
    header=self.header,
    )


    Only thing I noticed that stood out in this message is that there is a quotation followed by a hyphen. No other messages before it had that combo. Would someone mind telling me what is going wrong here?

    Continue reading...

Compartilhe esta Página