Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Unclear error message in apply method when most values are None #2066

Closed
alonpal opened this issue Jun 18, 2019 · 1 comment · Fixed by #2424
Closed

Unclear error message in apply method when most values are None #2066

alonpal opened this issue Jun 18, 2019 · 1 comment · Fixed by #2424

Comments

@alonpal
Copy link
Collaborator

alonpal commented Jun 18, 2019

When all rows used by the apply method for type inference return None, then the resulting SArray defaults to float. I know this can be solved by specifying dtype but the error message should be clearer, especially when considering lazy operations.

Running:

import turicreate as tc
a = tc.SArray(list(range(100000)))
b = a.apply(lambda x: None if x < 1000 else str(x))
b.materialize()

Results in:
TypeError: Cannot convert 41666 to float

I suggest something along the lines of TypeError: Cannot convert 41666 of type XXXX to float which is the type of the SArray. If this is not the correct type try specifying it during creation

@dhivyaaxim
Copy link
Contributor

@TobyRoseman @znation Please assign this ticket to me as I would like to try fixing it and contribute .Thanks in advance!

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

Successfully merging a pull request may close this issue.

5 participants