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

dict_keys and dict_values types do not work with filter_by #2221

Closed
TobyRoseman opened this issue Aug 9, 2019 · 2 comments · Fixed by #2470
Closed

dict_keys and dict_values types do not work with filter_by #2221

TobyRoseman opened this issue Aug 9, 2019 · 2 comments · Fixed by #2470
Assignees
Labels
bug engine p3 python3 Issues related specifically to Python 3

Comments

@TobyRoseman
Copy link
Collaborator

import turicreate as tc                                                                                                                                                                                                                                                                                                                                           

sa = tc.SArray(range(10))                                                                                                                                                                                                                                                                                                                                         
d = {1:1}

sa.filter_by(d.keys())         # Does not work 
sa.filter_by(d.values())       # Also does not work

# of course this can be solve by doing: 
sa.filter_by(list(d.keys()))
sa.filter_by(list(d.values()))

This issue is only effecting Python 3. This issues should also be fixed for sframe.filter_by.

The fix here could be quite similar to #1723. However we should consider doing something more general, rather than special casing each possible type. We probably want to allow any iterable type as input. Determining if an object is iterable is not straight forward.

@TobyRoseman TobyRoseman added engine python3 Issues related specifically to Python 3 labels Aug 9, 2019
@syoutsey syoutsey added the p3 label Aug 15, 2019
@znation znation added the bug label Sep 4, 2019
@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!

@znation
Copy link
Contributor

znation commented Oct 10, 2019

Thanks @dhivyaaxim!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug engine p3 python3 Issues related specifically to Python 3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants