18F / pulse

How the federal .gov domain space is doing at best practices and policies.
Other
94 stars 56 forks source link

change dict_row pattern to instead make use of DictReader #796

Closed buckley-w-david closed 6 years ago

buckley-w-david commented 6 years ago

This PR refactors the existing pattern of pulling the first line of a csv into a headers list, then using that list to construct a dict from every row to just using the existing functionality in the python csv library DictReader.

One thing that should be noted is that the behavior of this code will be slightly different in the case of csvs without a header row, but I believe that these would also fail with the existing code, just in another way.

konklone commented 6 years ago

Verified output is consistent. Thanks for the cleanup, @buckley-w-david!