Page MenuHomePhabricator

Steve's First Diff
Needs RevisionPublic

Authored by tido on Jan 19 2014, 2:24 AM.
Tags
None
Referenced Files
F18845315: D8009.diff
Oct 29 2025, 11:08 AM
F18749675: D8009.id18117.diff
Oct 4 2025, 4:43 AM
F18101002: D8009.id18117.diff
Aug 9 2025, 12:15 PM
F18100219: D8009.id.diff
Aug 9 2025, 11:46 AM
F18097473: D8009.diff
Aug 8 2025, 1:37 PM
Unknown Object (File)
May 30 2025, 9:36 AM
Unknown Object (File)
May 28 2025, 8:46 AM
Unknown Object (File)
May 27 2025, 12:57 PM
Subscribers

Details

Reviewers
None
Summary

(If you are not Steve, please ignore this diff! Evan said I could use secure.phabricator.com for a test diff!)

Test Plan

!

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

steve.py
22

Yes, you don't really need to worry about the efficiency of this operation - dicts are efficient and your program will scale well past Excel!

38–45

This business with the "t" array seems unnecessary. Python lets you do something like this:

for line in merchange_category_loaded_csv:
  merchant_categories[line['Key']] = line['Value']

(There are even more elegant ways of doing this in python using list comprehensions, but let's stick to this for now as it's a little easier conceptually.)

63

You can say something like:

(year, month, day) = re.split(...)

This will make it more legible :). I'm not sure I got the order of year/month/day correct, but hopefully you get the idea.

65–70

some commenting about what's going on would be nice, this is pretty confusing logic to me.

79–82

This try/except usage seems a little weird. I'd probably just do:

spend_amt = float(float_val.replace(',','')

and simplify it :)

111–119

It's not a terrible idea to put something like this in a separate function for readability.

113–117

What's with the numbers 34/17/8? Usually when you have "magic numbers", you want to explain what they are...

141

This comment could be better - you should explain why it wouldn't work (that's what I'm wondering as I read it).

151–152

I'm not sure what this is doing. Why can't you just take in a single list of dicts - why do you need two?

chad removed a reviewer: chad.