datopian / metastore-lib

🗄️ Library for storing dataset metadata, with versioning support and pluggable backends including GitHub.
https://tech.datopian.com/versioning/
MIT License
10 stars 1 forks source link

_get_owner() function fails when retrieving the name #7

Closed pdelboca closed 4 years ago

pdelboca commented 4 years ago

Executing repo = self._get_owner(owner).create_repo(repo_name) inside create(...) method fails with the following error:

*** UnknownObjectException: 404 {"documentation_url": "https://developer.github.com/v3/orgs/#get-an-organization", "message": "Not Found"}

How to Reproduce

More Info

I have created this account in order to use Github as a Backend, however the user object that the library gets is the following:

ipdb> pp self._user.raw_data
{
 ...
 u'login': u'pdelboca-datopian',
 u'name': None,
 ...
}

The name atribute is None since it does not correlates with the account (pdelboca-datopian), in fact the name attribute in github can be any string the user wants (like Patricio Del Boca) which is not gonna be useful.

Proposed solution

Use self._user.login instead of self._user.name