Skip to content

TypeError: cannot use a string pattern on a bytes-like object #8

@AndrewH-Lab49

Description

@AndrewH-Lab49

using a live connection to my clients workday:

tap-workday-raas | File "/src/streams/workday-s3/.meltano/extractors/tap-workday-raas/venv/lib/python3.8/site-packages/tap_workday_raas/client.py", line 46, in stream_report
tap-workday-raas | coro.send(chunk)
tap-workday-raas | File "/src/streams/workday-s3/.meltano/extractors/tap-workday-raas/venv/lib/python3.8/site-packages/ijson/backends/python.py", line 39, in Lexer
tap-workday-raas | match = LEXEME_RE.search(buf, pos)
tap-workday-raas | TypeError: cannot use a string pattern on a bytes-like object

in client.py on line 46 I replace

coro.send(chunk)

with

coro.send(chunk.decode(resp.encoding))

and I get:

tap-workday-raas | INFO Done syncing.
meltano | Incremental state has been updated at 2021-06-11 12:33:28.720672.
meltano | Extract & load complete!

I am not convinced that this is the best solution. Perhaps using the Content-Type first to get the xml encoding before using requests guess at encoding might be better? The above example was just trying to be helpful.

I am not sure how this impacts the existing unit test?

I had a hard time working with the unit tests without spending too much time. For instance I do not know where tap_tester comes from. It didn't pip install and wasn't part of setup process. I don't believe I have access to the circle docker image, S3....

Please excuse me if I missed something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions