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

cast key to string #46

Merged
merged 1 commit into from Jul 23, 2020
Merged

cast key to string #46

merged 1 commit into from Jul 23, 2020

Conversation

a246530
Copy link
Contributor

@a246530 a246530 commented Jul 23, 2020

In some cases the key is a boolean value not a string. A keyerror is produced when a boolean value appears in key. Reference #42

I was able to recreate the issue as user described and was able to fix by casting key as string. It seems like the key should always be a string.

In some cases the key is a boolean value  not a string. A keyerror is produced when a boolean value appears in key.
@fbdesignpro
Copy link
Owner

@a246530 Feels safe, merging. Do you have a mini test case you could share here for reference?

@fbdesignpro
Copy link
Owner

@a246530 To clarify I'm just curious how a boolean got in there, making sure the report data is fine with other datatypes, and could be a useful test case for future extensions.

@fbdesignpro fbdesignpro merged commit 2a7b793 into fbdesignpro:master Jul 23, 2020
@fbdesignpro
Copy link
Owner

@a246530 Also, can you verify if it helps with #40?

@a246530
Copy link
Contributor Author

a246530 commented Jul 23, 2020

@fbdesignpro it does appear to fix #40 as well.
I will point out that i now get these messages. No failure. Continues to run.
C:\Users\user\AppData\Roaming\Python\Python38\site-packages\pandas\core\ops\array_ops.py:253: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
res_values = method(rvalues)
C:\Users\user\AppData\Roaming\Python\Python38\site-packages\pandas\core\ops\array_ops.py:253: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
res_values = method(rvalues)
C:\Users\user\AppData\Roaming\Python\Python38\site-packages\pandas\core\ops\array_ops.py:253: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
res_values = method(rvalues)
C:\Users\user\AppData\Roaming\Python\Python38\site-packages\pandas\core\ops\array_ops.py:253: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
res_values = method(rvalues)
C:\Users\user\AppData\Roaming\Python\Python38\site-packages\pandas\core\ops\array_ops.py:253: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
res_values = method(rvalues)

@fbdesignpro
Copy link
Owner

@a246530 ouch; does it happen everywhere or only with that problem data?

@a246530
Copy link
Contributor Author

a246530 commented Jul 23, 2020

Just around the data fields that had the key value as boolean.

@fbdesignpro
Copy link
Owner

ok phew; if it's possible, definitely send a test here, I'll check it out when I have a minute (hopefully soon!) Thank you!!

@a246530
Copy link
Contributor Author

a246530 commented Jul 23, 2020

You can use #42 or #40 examples to generate the messages. I will explore further as well.

@fbdesignpro
Copy link
Owner

I think I got it, 904a11a should take care of it.

@a246530
Copy link
Contributor Author

a246530 commented Jul 27, 2020

Ahh yea, sorry about that. Originally i had an if statement that checked it it was bool but your fix in 904a11a looks better.

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

Successfully merging this pull request may close these issues.

None yet

2 participants