ropensci / patentsview

An R client to the PatentsView API
https://docs.ropensci.org/patentsview
Other
32 stars 9 forks source link

Travis job failures #10

Closed mustberuss closed 6 years ago

mustberuss commented 6 years ago

I noticed that the Travis job failed after my PR due to the failure of two tests.

  1. test-unnest-pv-data.R:10: error: assignee_id cannot act as a primary key because it is not a unique identifier.

Try using assignee_id instead.

The test appears to be reasonable, ie it should work as written. Could the assert that's failing in unnest-pv-data.R be prefaced with an if(ok_pk != pk)? I did that locally and the test passed. Or is the test itself coded improperly?

  1. test-cast-pv-data.R:10: error: cast_pv_data casts data types as expected could not find function "fun_list"

It looks like the api's web pages added forprior_sequence and lawyer_sequence as "int" not "integer" on all seven endpoints. As a local hack I added "int" = as.integer, in get_cast_fun in cast-pv-data.R and the test passed. Possibly better to handle the int to integer in fieldsdf.R and/or throw an error when a type isn't recognized?

Not knowing the right way to fix either problem I didn't push either change.

crew102 commented 6 years ago

Yes, I looked briefly over these failures. Regarding the unnest_pv_data test, the issue is the API is serving some of the new data fields (e,g., pct_data) in a strange format (i.e., one that is not consistent with the other fields). I have opened up an issue with them to fix this (https://github.com/CSSIP-AIR/PatentsView-API/issues/27). Regarding testing cast_pv_data, went ahead and updated fieldsdf to show integer instead of int, which fixes the second failing test you mentioned.

crew102 commented 6 years ago

Closed by https://github.com/ropensci/patentsview/commit/af888a3ff1e1c7066913121bf4b645f2483f1990 and https://github.com/CSSIP-AIR/PatentsView-API/issues/27