-
Notifications
You must be signed in to change notification settings - Fork 722
add test for pandas argument and encoding #273
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
add test for pandas argument and encoding #273
Conversation
|
Thanks a lot @bryanyang0528! You can ignore the failed check above, it's my fault, I will fix it. |
|
Thanks! |
igorborgest
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the TypeError expected? Pandas only support a single character as line terminator. So are we using "\r\n" to force the exceptions? I think I didn't get the point here.
In addition to that, if the exception was intentional, what you think about make pytest expect it like in this example?
|
@igorborgest yes, you are right. I forgot this way. |
|
@bryanyang0528 this error is weird. Seems that the mocking are not working as expected. Btw, what is the purpose of mocking these function? Why not let it simply run against |
|
@igorborgest I saw that you parsed parameters like |
|
@bryanyang0528 Oh I see. And are you expecting this error raised from |
|
@igorborgest This exception is intentional for me.
So when I mock |
|
@bryanyang0528 Understood. Thanks for the extended explanation! |

Issue #, if available:
add unit test for #271
Description of changes:
Add a unit test for testing pandas argument and
encodingandnewlineargument for thefs.opencommand(https://github.com/awslabs/aws-data-wrangler/blob/b57e2b7245e999191918022341943884e49b2e4e/awswrangler/s3.py#L1654)p.s. Because
pandas.read_csvis in thepandas.concatsection, aTypeErrorwill raise whenconcatget a mock object returned frompandas.read_csv. So I used a try catch block to aviod the exception.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.