Closed pietermarsman closed 7 years ago
Thanks for the merge request. Reviewing this now.
I'm getting errors when trying to use this @pietermarsman . the unittests pass but trying to query gives errors. There appears to be a difference in column lengths; english has 62 columns. Translingual events appears to have 61. Haven't checked the other tables yet (mentions, gkg).
What do you mean by:
trying to query gives errors
Maybe you can write a unittest that tests the wrong behavior?
I am not able to replicate the different number of columns.
My output:
>>> gdelt.gdelt().Search("2017 07 08", translation=False).shape
(1281, 62)
>>> gdelt.gdelt().Search("2017 07 08", translation=True).shape
(576, 62)
@pietermarsman I figured it out. It was not your PR that caused the problem, it was the library overall and GDELT service. The main problem I had to fix was adding an exception for queries that returned zero data. For example, if you run this query:
checked = gd.Search('2017 Jul 27', translation=True)
it will recreate the error I saw. This is explaining more than you care about, but the problem is the GDELT (the service) does not have a url for http://data.gdeltproject.org/gdeltv2/20170727234500.gkg.csv.zip
so it returns zero data. It looks like GDELT (the service) went down or had an error on some days and failed to provide a news file.
Added a parameter
translation
to Seach and use it inurlBuilder
to get paths to the translated files.This fixes #26 .