Quantipy / quantipy

Python for people data
MIT License
66 stars 14 forks source link

dataset.meta_to_json() string join error #1296

Closed avilaton closed 5 years ago

avilaton commented 5 years ago

I found this error while using dataset.meta_to_json() and submit this fix

~/quantipy/quantipy/core/dataset.pyc in meta_to_json(self, key, collection)
    801                                  if key else '')
    802         ds_path = '../' if self.path == '/' else self.path
--> 803         path = os.path.join(ds_path, ''.json([self.name, '_', name, '.json']))
    804         with open(path, 'w') as file:
    805             json.dump(obj, file)

AttributeError: 'str' object has no attribute 'json'

In [11]: dataset.meta_to_json()
alextanski commented 5 years ago

Ha! Thanks for spotting that @avilaton . @nitsrek Can you quickly check then merge to develop as well?

avilaton commented 5 years ago

I did not have time to check how test are made but this should probably be accompanied by a test covering it.

alextanski commented 5 years ago

@nitsrek Please review and then pick this up in your py3/clean up branch. Thank you!