Skip to content

Revert "TST: skip pytables test with not-updated pytables conda packa… #22188

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

Closed

Conversation

TomAugspurger
Copy link
Contributor

@TomAugspurger TomAugspurger commented Aug 3, 2018

…ge (#22099)"

This reverts commit 017e910.

closes #22098

@TomAugspurger
Copy link
Contributor Author

@jreback do you recall why you added this skip? #22178 is failing because it wasn't backported with errors like

=================================== FAILURES ===================================
__________________ TestHDFStore.test_calendar_roundtrip_issue __________________
self = <pandas.tests.io.test_pytables.TestHDFStore object at 0x7f9cd07d7908>
    def test_calendar_roundtrip_issue(self):
    
        # 8591
        # doc example from tseries holiday section
        weekmask_egypt = 'Sun Mon Tue Wed Thu'
        holidays = ['2012-05-01',
                    datetime.datetime(2013, 5, 1), np.datetime64('2014-05-01')]
        bday_egypt = pd.offsets.CustomBusinessDay(
            holidays=holidays, weekmask=weekmask_egypt)
        dt = datetime.datetime(2013, 4, 30)
        dts = date_range(dt, periods=5, freq=bday_egypt)
    
        s = (Series(dts.weekday, dts).map(
            Series('Mon Tue Wed Thu Fri Sat Sun'.split())))
    
        with ensure_clean_store(self.path) as store:
    
>           store.put('fixed', s)
pandas/tests/io/test_pytables.py:2160: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pandas/io/pytables.py:890: in put
    self._write_to_group(key, value, append=append, **kwargs)
pandas/io/pytables.py:1367: in _write_to_group
    s.write(obj=value, append=append, complib=complib, **kwargs)
pandas/io/pytables.py:2808: in write
    self.write_index('index', obj.index)
pandas/io/pytables.py:2553: in write_index
    node._v_attrs.freq = index.freq
../../../miniconda3/envs/pandas/lib/python3.6/site-packages/tables/attributeset.py:494: in __setattr__
    self._g__setattr(name, value)
../../../miniconda3/envs/pandas/lib/python3.6/site-packages/tables/attributeset.py:436: in _g__setattr
    self._g_setattr(self._v_node, name, stvalue)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
>   ???
E   BufferError: could not get scalar buffer information
tables/hdf5extension.pyx:708: BufferError

@TomAugspurger
Copy link
Contributor Author

I can reproduce that locally.

@TomAugspurger
Copy link
Contributor Author

Hmm this CustomBusinessDay isn't picklable

(Pdb) stvalue
<CustomBusinessDay>
(Pdb) pickle.dumps(stvalue)
*** BufferError: could not get scalar buffer information

tha'ts the same error eventually coming from pytables, so this is likely on us.

@TomAugspurger
Copy link
Contributor Author

        holidays = ['2012-05-01',
                    datetime.datetime(2013, 5, 1), np.datetime64('2014-05-01')]

that np.datetime64('2014-05-01') can't be pickled. Anyone know why we construct the holidays like that?

@jreback
Copy link
Contributor

jreback commented Aug 3, 2018

@TomAugspurger I did this because I thought the pytables packages was not completely compat with numpy 1.15. Not really sure though. If it passes now, maybe the package was updated? this started failing as soon as 1.15 was released.

@TomAugspurger
Copy link
Contributor Author

Gotcha, I think it's just NumPy 1.15. numpy/numpy#11656

@TomAugspurger
Copy link
Contributor Author

I don't see an easy workaround... So I think I'm going to just cherry pick the skip to the backports.

@jreback
Copy link
Contributor

jreback commented Aug 3, 2018

ahh good to know. thanks @TomAugspurger

@gfyoung gfyoung added Testing pandas testing functions or related to the test suite Build Library building on various platforms labels Aug 4, 2018
@adaag
Copy link

adaag commented Aug 8, 2018

@TomAugspurger
def parallel_apply(data, fun, args):
pool = mp.Pool(mp.cpu_count() - 1)
result = [pool.apply(fun, (data.loc[x, :], *args)) for x in data.index]
result = [p.get() for p in result]
end_result = pd.concat(result)
return end_result

from this part of code i also get following error "BufferError: could not get scalar buffer information". i tried several things to solve it but non of them worked. Any sugesstion? Thanks for help

@jreback
Copy link
Contributor

jreback commented Aug 8, 2018

closing this, pending resolution of #22098 which is pending numpy/numpy#11656

@jreback jreback closed this Aug 8, 2018
@TomAugspurger TomAugspurger deleted the revert-017e910 branch August 21, 2018 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TST: remove skip for pytables build issue on numpy 1.15
4 participants