Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delimited file config customization is lacking skipinitialspace #31

Open
sebastianswms opened this issue Jul 13, 2023 · 0 comments
Open

Comments

@sebastianswms
Copy link
Collaborator

Testing using the s3 bucket derek-tap-filetesting failed due to the deniro.csv file with the error:

Traceback (most recent call last):
  File "/git/tap-universal-file/.venv/lib/python3.11/site-packages/singer_sdk/streams/core.py", line 1166, in sync
    for _ in self._sync_records(context=context):
  File "/git/tap-universal-file/.venv/lib/python3.11/site-packages/singer_sdk/streams/core.py", line 1061, in _sync_records
    for record_result in self.get_records(current_context):
  File "/git/tap-universal-file/tap_universal_file/client.py", line 197, in get_records
    yield from self.get_rows()
  File "/git/tap-universal-file/tap_universal_file/streams.py", line 30, in get_rows
    for row in reader:
  File "/git/tap-universal-file/tap_universal_file/streams.py", line 186, in __next__
    raise RuntimeError(msg)
RuntimeError: Error processing derek-tap-filetesting/2023/deniro.csv at line 4. Total number of column headers (3) doesn't align with the number of fields in the data (4). To suppress this error, change delimited_error_handling to 'ignore'.

The first lines of the deniro.csv file are:

"Year", "Score", "Title"
1968,  86, "Greetings"
1970,  17, "Bloody Mama"
1970,  73, "Hi, Mom!"

Currently, the tap interprets line 4 as being four separate fields despite the doublequotes around Hi, Mom! because it sees that the first character after the comma following 73 is a space. Implementing skipinitialspace from csv.DictReader would solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant