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

Getting error about string argument without encoding when writing a CSV reader #563

Closed
kszlim opened this issue Feb 6, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@kszlim
Copy link

kszlim commented Feb 6, 2022

Was testing out develop branch due needing this change #558

chunks = tuple([dict(zip(self.header, line.split(bytes(self.separator)))) for line in process.split(b"\n")])  # type: ignore
TypeError: string argument without an encoding

This was specifically when using a CSVReader with chunked=False and as_dataframe=False

chunks = tuple([dict(zip(self.header, line.split(bytes(self.separator)))) for line in process.split(b"\n")]) # type: ignore

This line breaks due to missing string encoding in the bytes function.

@cjdsellers
Copy link
Member

Hi @kszlim thanks for reporting this!

We'll look into it as soon as we can, bandwidth dependent. Hopefully this week though.

@cjdsellers cjdsellers added the bug Something isn't working label Feb 6, 2022
cjdsellers pushed a commit that referenced this issue Mar 27, 2022
- Fix mapping_bug
- Fix for #563
@cjdsellers
Copy link
Member

Fixed from #593
Many thanks to @limx0 🚀

@772435284
Copy link

772435284 commented Jul 31, 2022

I think it is not fixed, I still get the error when running the code in https://docs.nautilustrader.io/user_guide/loading_external_data.html. If I do not specify my decoding method in the code, the error still exists. Otherwise, this line should be changed to chunks = tuple([dict(zip(self.header, line.split(bytes(self.separator,encoding='utf8')))) for line in process.split(b"\n")]) # type: ignore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants