Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Issue 2518663002: Converting various classes to namedtuples (Closed)

Created:
4 years, 1 month ago by wrengr
Modified:
4 years, 1 month ago
CC:
chromium-reviews, infra-reviews+infra_chromium.org, aarya
Target Ref:
refs/heads/master
Project:
infra
Visibility:
Public.

Description

Converting various classes to namedtuples Also re-removing callstack.py, since a previous CL moved it into stacktrace.py but somehow that got rebased improperly. BUG=661822 Committed: https://chromium.googlesource.com/infra/infra/+/9cacec9460f8fbcbb6cfe2f4bb4def59c3fc6386

Patch Set 1 #

Total comments: 9

Patch Set 2 : addressing nits #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+167 lines, -382 lines) Patch
D appengine/findit/crash/callstack.py View 1 chunk +0 lines, -163 lines 0 comments Download
M appengine/findit/crash/changelist_classifier.py View 6 chunks +13 lines, -12 lines 0 comments Download
M appengine/findit/crash/results.py View 1 3 chunks +12 lines, -4 lines 0 comments Download
M appengine/findit/crash/stacktrace.py View 3 chunks +11 lines, -11 lines 0 comments Download
D appengine/findit/crash/test/callstack_test.py View 1 chunk +0 lines, -98 lines 0 comments Download
M appengine/findit/crash/test/results_test.py View 7 chunks +19 lines, -8 lines 0 comments Download
M appengine/findit/crash/test/stacktrace_test.py View 1 chunk +2 lines, -2 lines 0 comments Download
M appengine/findit/lib/gitiles/change_log.py View 3 chunks +59 lines, -31 lines 3 comments Download
M appengine/findit/util_scripts/git_checkout/local_git_parsers.py View 5 chunks +47 lines, -50 lines 0 comments Download
M appengine/findit/util_scripts/git_checkout/test/local_git_parsers_test.py View 1 chunk +3 lines, -3 lines 0 comments Download
M appengine/findit/util_scripts/git_checkout/test/local_git_repository_test.py View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 18 (5 generated)
wrengr
PTAL
4 years, 1 month ago (2016-11-18 20:37:15 UTC) #1
wrengr
PTAL
4 years, 1 month ago (2016-11-21 19:19:00 UTC) #3
chromium-reviews
Somehow I only see the second publish today, reviewing :) On Mon, Nov 21, 2016 ...
4 years, 1 month ago (2016-11-21 22:48:46 UTC) #4
Sharu Jiang
lgtm with some comments. https://codereview.chromium.org/2518663002/diff/1/appengine/findit/crash/results.py File appengine/findit/crash/results.py (right): https://codereview.chromium.org/2518663002/diff/1/appengine/findit/crash/results.py#newcode14 appengine/findit/crash/results.py:14: # it's necessary, given that ...
4 years, 1 month ago (2016-11-21 23:31:57 UTC) #5
wrengr
https://codereview.chromium.org/2518663002/diff/1/appengine/findit/crash/results.py File appengine/findit/crash/results.py (right): https://codereview.chromium.org/2518663002/diff/1/appengine/findit/crash/results.py#newcode14 appengine/findit/crash/results.py:14: # it's necessary, given that every use in this ...
4 years, 1 month ago (2016-11-22 18:33:41 UTC) #6
Sharu Jiang
https://codereview.chromium.org/2518663002/diff/1/appengine/findit/crash/results.py File appengine/findit/crash/results.py (right): https://codereview.chromium.org/2518663002/diff/1/appengine/findit/crash/results.py#newcode14 appengine/findit/crash/results.py:14: # it's necessary, given that every use in this ...
4 years, 1 month ago (2016-11-22 18:53:52 UTC) #7
wrengr
On 2016/11/22 18:53:52, Sharu Jiang wrote: > https://codereview.chromium.org/2518663002/diff/1/appengine/findit/crash/results.py > File appengine/findit/crash/results.py (right): > > https://codereview.chromium.org/2518663002/diff/1/appengine/findit/crash/results.py#newcode14 ...
4 years, 1 month ago (2016-11-22 19:19:44 UTC) #8
Sharu Jiang
On 2016/11/22 19:19:44, wrengr wrote: > On 2016/11/22 18:53:52, Sharu Jiang wrote: > > > ...
4 years, 1 month ago (2016-11-22 19:59:56 UTC) #9
stgao
lgtm with a nit. https://codereview.chromium.org/2518663002/diff/20001/appengine/findit/lib/gitiles/change_log.py File appengine/findit/lib/gitiles/change_log.py (right): https://codereview.chromium.org/2518663002/diff/20001/appengine/findit/lib/gitiles/change_log.py#newcode46 appengine/findit/lib/gitiles/change_log.py:46: return { IIRC, namedtuple has ...
4 years, 1 month ago (2016-11-22 21:22:59 UTC) #10
wrengr
https://codereview.chromium.org/2518663002/diff/20001/appengine/findit/lib/gitiles/change_log.py File appengine/findit/lib/gitiles/change_log.py (right): https://codereview.chromium.org/2518663002/diff/20001/appengine/findit/lib/gitiles/change_log.py#newcode46 appengine/findit/lib/gitiles/change_log.py:46: return { On 2016/11/22 21:22:59, stgao (slow on Monday) ...
4 years, 1 month ago (2016-11-22 21:32:39 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2518663002/20001
4 years, 1 month ago (2016-11-22 21:33:00 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/infra/infra/+/9cacec9460f8fbcbb6cfe2f4bb4def59c3fc6386
4 years, 1 month ago (2016-11-22 21:48:23 UTC) #17
stgao
4 years, 1 month ago (2016-11-22 21:50:40 UTC) #18
Message was sent while issue was closed.
https://codereview.chromium.org/2518663002/diff/20001/appengine/findit/lib/gi...
File appengine/findit/lib/gitiles/change_log.py (right):

https://codereview.chromium.org/2518663002/diff/20001/appengine/findit/lib/gi...
appengine/findit/lib/gitiles/change_log.py:46: return {
On 2016/11/22 21:32:39, wrengr wrote:
> On 2016/11/22 21:22:59, stgao (slow on Monday) wrote:
> > IIRC, namedtuple has an equivalent func of this, but I can't find it out
> > immediately. Mind a check?
> 
> There's the ``_asdict`` method, which returns an ``OrderedDict``. (Just as one
> can use ``MyNamedTuple(**some_dict)`` to implement something like
``FromDict``.)
> However I'm a bit wary of using it directly because of semantic mismatch. The
> goal of ``_asdict`` is to convert a namedtuple into a Python ``dict`` for
> introspection purposes; whereas, the goal of ToDict is to convert the
namedtuple
> into JSON for sending over the wire. The names of fields in Python need not be
> the same as the names of the fields in JSON, and indeed we already have cases
> where they differ.

Good point. Sgtm!

Powered by Google App Engine
This is Rietveld 408576698