Skip to content

REF/TST: misplaced hashtable tests, rename HashTable.map map_keys_to_values #46106

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

Merged
merged 2 commits into from
Feb 26, 2022

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@mroeschke mroeschke added this to the 1.5 milestone Feb 22, 2022
@mroeschke mroeschke added Internals Related to non-user accessible pandas implementation Refactor Internal refactoring of code labels Feb 22, 2022
@jreback jreback merged commit d70d9b3 into pandas-dev:main Feb 26, 2022
@jbrockmendel jbrockmendel deleted the ref-kh-fused branch February 26, 2022 20:15
@lukemanley
Copy link
Member

Not sure if these errors are related to this PR or not, but seeing several CI build failures on the test below:

Examples that have failed this test:
#46163
#45575

def test_vector_resize(
        self, writable, htable, uniques, dtype, safely_resizes, nvals
    ):
        # Test for memory errors after internal vector
        # reallocations (GH 71[57](https://github.com/pandas-dev/pandas/runs/5348598022?check_suite_focus=true#step:11:57))
        vals = np.array(np.random.randn(1000), dtype=dtype)
    
        # GH 21[68](https://github.com/pandas-dev/pandas/runs/5348598022?check_suite_focus=true#step:11:68)8 ensures we can deal with read-only memory views
        vals.setflags(write=writable)
    
        # initialise instances; cannot initialise in parametrization,
        # as otherwise external views would be held on the array (which is
        # one of the things this test is checking)
        htable = htable()
        uniques = uniques()
    
        # get_labels may append to uniques
        htable.get_labels(vals[:nvals], uniques, 0, -1)
        # to_array() sets an external_view_exists flag on uniques.
        tmp = uniques.to_array()
        oldshape = tmp.shape
    
        # subsequent get_labels() calls can no longer append to it
        # (except for StringHashTables + ObjectVector)
        if safely_resizes:
            htable.get_labels(vals, uniques, 0, -1)
        else:
            with pytest.raises(ValueError, match="external reference.*"):
>               htable.get_labels(vals, uniques, 0, -1)
E               Failed: DID NOT RAISE <class 'ValueError'>

@jreback
Copy link
Contributor

jreback commented Feb 27, 2022

@lukemanley possible. have merge quite a lot of things. happy to take a patch if this is still happening on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internals Related to non-user accessible pandas implementation Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants