Closed pdgonzalez872 closed 8 years ago
Hi Paulo. Thanks for your interest. The issue seems to be here:
ERROR: invalid byte sequence for encoding "UTF8": 0xe3 0xb8 0x52 CONTEXT: COPY players, line 12835 UPDATE 0 Players Imported.
Since no players are imported, the test cases all fail, since they all depend on players existing. Pretty shoddy testing, I know. Will try and improve that.
As for why the players aren't imported. The _atpplayers.csv in the tennis_atp
repo file has some characters that aren't suitable for UTF-8 encoding, so it throws an error, and no players are imported. In fact this happens in a few other files too, and none of those find their way into the db. But I didn't notice this earlier, as there are plenty of match/ranking CSVs, but only one players CSV. Apparently I had corrected the file in my local copy but never thought to push it up.
I've made the required changes to the files in my _utf8encoding branch of the tennis_atp
repo. If you merge this with your development branch and rerun the psql-setup script, you should be good to go.
All in all, thanks for that. You've shown me a lot of things I still need to do to make these repos usable. Do let me know if you come across any other mistakes.
Fixed in master.
Hi @harman28! Thanks for working on this. I wanted to contribute and was getting familiar with the project. I tried to follow the setup instructions but things don't seem to be coming together.
I wanted to run the specs for the gem by itself. I followed the directions here. Here is the output:
And then, trying to run
rspec
:Atpruby Has a version number Scopes for Matches work (FAILED - 1) Associations for Matches work (FAILED - 2) Slam_finals (using union) for Players works (FAILED - 3) Matches method (using union) for Players works (FAILED - 4) H2H methods for Players work (FAILED - 5) Rankings assoc for Players works (FAILED - 6)
Failures:
1) Atpruby Scopes for Matches work Failure/Error: expect(finalists).to include('Federer') expected [] to include "Federer"
./spec/atpruby_spec.rb:10:in `block (2 levels) in <top (required)>'
2) Atpruby Associations for Matches work Failure/Error: winner = Match.in_1969.slams.finals.sample.winner.lastname
3) Atpruby Slam_finals (using union) for Players works Failure/Error: firstfinal = borg.slam_finals.order(:match_date).first.tourney_id
4) Atpruby Matches method (using union) for Players works Failure/Error: lastmatch = connors.matches.order(:match_date).last
5) Atpruby H2H methods for Players work Failure/Error: lastwinner = borg.h2h_details(mcenroe).order(:match_date).last.winner.lastname
6) Atpruby Rankings assoc for Players works Failure/Error: lastyear = lendl.rankings.where(pos:1).order(:ranking_date).last.ranking_date.year
Finished in 0.73969 seconds (files took 1.34 seconds to load) 7 examples, 6 failures
Failed examples:
rspec ./spec/atpruby_spec.rb:8 # Atpruby Scopes for Matches work rspec ./spec/atpruby_spec.rb:13 # Atpruby Associations for Matches work rspec ./spec/atpruby_spec.rb:18 # Atpruby Slam_finals (using union) for Players works rspec ./spec/atpruby_spec.rb:24 # Atpruby Matches method (using union) for Players works rspec ./spec/atpruby_spec.rb:31 # Atpruby H2H methods for Players work rspec ./spec/atpruby_spec.rb:40 # Atpruby Rankings assoc for Players works
I was wondering if you have any insight on this. Please let me know if you do!
Thanks!