ranaroussi / pystore

Fast data store for Pandas time-series data
Apache License 2.0
565 stars 101 forks source link

Trying to load collection on windows 10 causes TypeError #27

Closed JugglingNumbers closed 5 years ago

JugglingNumbers commented 5 years ago

Hi Ran, On windows 10 anaconda 3.5 install, when I tried to load a collection with the following code I got:

pystore.set_path(str('C:\\jupyter_notebooks\\zipline\\pystore'))
clc = pystore.store('data').collection('weather')

TypeError: join() argument must be str or bytes, not 'WindowsPath'

I was able to correct this by changing line 110 in utils.py from: return Path(os.path.join(*args)) to return Path(os.path.join(*[str(x) for x in args]))

I'm not sure but I think this change will be safe for non-windows installs.

Hugovdberg commented 5 years ago

This looks more like pathlib and os.path are mixed in the code, whereas pathlib also provides this functionality to join paths. This should also work (see also https://docs.python.org/3/library/pathlib.html#pure-paths):

    return Path(*args)
ranaroussi commented 5 years ago

Fixed in 0.1.15. Please reopen issue if the problem persists.