andrewxhill / MOL

The Map of Life
mol.colorado.edu/
19 stars 4 forks source link

Case sensitivity in DBF column names #105

Closed tucotuco closed 13 years ago

tucotuco commented 13 years ago

When reading required and optional columns from csv files in source2csv() in loader.py, case is important, meaning the config.yaml column mappings must match the DBF column names exactly. It would be great to case insensitive matching.

@gaurav: Game for this one?

gaurav commented 13 years ago

I am! I'm trying to think of a cleverer way of doing it, but I can always just read the first line of the CSV file manually and then turn that into lowercase before handing it over to csv.DictReader. Unfortunately, @4135305db seems to have messed up loader.py on my computer to some extent. I'll open issues on that once I track down exactly what happened.

eightysteele commented 13 years ago

@gaurav: What got messed up in @4135305? Do you have error output? @tucotuco and I should be able to narrow it down pretty quickly.

gaurav commented 13 years ago

Sorry for not being more detailed: since nobody else was complaining, I figured I could spend some time fixing the issue myself (and learning a bit more Python in the process!). Part of it was the bug I fixed in @9c0d1c2b659: loader.py on my computer wasn't os.chdir-ing to the correct directory when it started and, once I fixed that, it wasn't getting back to the directory it started in, so it would stop working once it finished processing the first file. Another minor bug I just fixed in @300a1a12fde.

Right now, I'm getting confused by two other bugs. Let me report them - check out issue #106 and let me know if you can reproduce any of that.

gaurav commented 13 years ago

Fixed in @2b86b16 and closing. Please let me know if you notice any problems with this in the future!