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

[REVIEW] Fix issue with set-item incase of list and struct types #11760

Merged
merged 4 commits into from
Sep 26, 2022

Conversation

galipremsagar
Copy link
Contributor

Description

Fixes: #11721
This PR:

In [9]: i = cudf.Scalar([10, 11])
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File /nvme/0/pgali/envs/cudfdev/lib/python3.9/site-packages/cudf/core/scalar.py:51, in CachedScalarInstanceMeta.__call__(self, value, dtype)
     49 try:
     50     # try retrieving an instance from the cache:
---> 51     self.__instances.move_to_end(cache_key)
     52     return self.__instances[cache_key]

KeyError: ([10, 11], <class 'list'>, None, <class 'NoneType'>)

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
Cell In [9], line 1
----> 1 i = cudf.Scalar([10, 11])

File /nvme/0/pgali/envs/cudfdev/lib/python3.9/site-packages/cudf/core/scalar.py:57, in CachedScalarInstanceMeta.__call__(self, value, dtype)
     53 except KeyError:
     54     # if an instance couldn't be found in the cache,
     55     # construct it and add to cache:
     56     obj = super().__call__(value, dtype=dtype)
---> 57     self.__instances[cache_key] = obj
     58     if len(self.__instances) > self.__maxsize:
     59         self.__instances.popitem(last=False)

TypeError: unhashable type: 'list'

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@galipremsagar galipremsagar added bug Something isn't working 3 - Ready for Review Ready for review by team Python Affects Python cuDF API. 4 - Needs cuDF (Python) Reviewer non-breaking Non-breaking change labels Sep 23, 2022
@galipremsagar galipremsagar requested a review from a team as a code owner September 23, 2022 22:33
@galipremsagar galipremsagar self-assigned this Sep 23, 2022
@codecov
Copy link

codecov bot commented Sep 24, 2022

Codecov Report

❗ No coverage uploaded for pull request base (branch-22.10@cd60462). Click here to learn what that means.
Patch has no changes to coverable lines.

❗ Current head 31b8ae7 differs from pull request most recent head 4d76161. Consider uploading reports for the commit 4d76161 to get more accurate results

Additional details and impacted files
@@               Coverage Diff               @@
##             branch-22.10   #11760   +/-   ##
===============================================
  Coverage                ?   87.52%           
===============================================
  Files                   ?      133           
  Lines                   ?    21777           
  Branches                ?        0           
===============================================
  Hits                    ?    19061           
  Misses                  ?     2716           
  Partials                ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@galipremsagar galipremsagar added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team 4 - Needs cuDF (Python) Reviewer labels Sep 26, 2022
@galipremsagar
Copy link
Contributor Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 11156cc into rapidsai:branch-22.10 Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Unable to perform setitem operations on slices of struct and list columns
2 participants