seamusabshere / data_miner

Download, unpack from a ZIP/TAR/GZ/BZ2 archive, parse, correct, convert units and import Google Spreadsheets, XLS, ODS, XML, CSV, HTML, etc. into your ActiveRecord models. Uses RemoteTable gem internally.
MIT License
302 stars 21 forks source link

mysql cli errors aren't handled #7

Closed seamusabshere closed 14 years ago

seamusabshere commented 14 years ago

rather than blowing up on the missing column, this should have blown up when the mysql cli command failed

vagrant@vagrantbase:~/cm1$ rake data_miner:run RESOURCES=AirConditionerUse DONT_RAISE=true
(in /home/vagrant/cm1)
DEPRECATION WARNING: Base#before_save has been deprecated, please use Base.before_save :method instead. (called from /home/vagrant/.bundle/ruby/1.8/gems/delayed_job-1.8.5/lib/delayed/job.rb:275)
ERROR 1064 (42000) at line 1 in file: '/tmp/0.21243237647898': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://ww' at line 1
rake aborted!
No such column: residential_energy_consumption_survey_responses.residence_class

(See full trace by running task with --trace)
seamusabshere commented 14 years ago

we don't use mysql like this anymore---we use taps