PMXBOT Log file Viewer

Help | Karma | Search:

#pypa-dev logs for Saturday the 11th of January, 2020

(Back to #pypa-dev overview) (Back to channel listing) (Animate logs)
[15:51:02] <MVrachev> Hi everyone, I am new to warehouse and I started working on issue https://github.com/pypa/warehouse/issues/5714. I had problems while using the db The SQLAlchemy ORM Session object.
[15:52:30] <MVrachev> My idea was to get the role of a specific contributor in a certain project and the way I did that is:
[15:52:56] <MVrachev> db.query(Project).join(User, Project.users).filter(User.username == "ewdurbin", Project.name == 'exhale').with_entities(Project.name, User.username, Role.role_name).distinct(Role.role_name).all()
[15:53:46] <MVrachev> but then I saw an anomaly - it seems that ewdurbin user has two roles for the same project because I get that output:
[15:53:53] <MVrachev> [('exhale', 'ewdurbin', 'Maintainer'), ('exhale', 'ewdurbin', 'Owner')]
[15:54:17] <MVrachev> I don't understand what is the problem. The query itself looks like this:
[15:54:30] <EWDurbin> https://github.com/pypa/warehouse/issues/2745
[15:54:41] <EWDurbin> It’s a known issue that hasn’t been addressed
[15:56:44] <MVrachev> but in this issue description Dustin mention this pr https://github.com/pypa/warehouse/pull/2705 which hides the duplications
[15:56:48] <MVrachev> and it's merged
[15:57:14] <EWDurbin> Just hides it in display, the database itself has never been cleaned up.
[15:57:40] <MVrachev> Ahaa, I understand. Then this shouldn't bother me.
[15:58:07] <MVrachev> Thanks for your fast response EWDurbin :))
[15:58:40] <EWDurbin> Heh, helps that my username is in the code you posted :-D
[15:59:07] <MVrachev> '=D