Open chgl opened 1 year ago
we got the same issue when trying to generate json file using Achilles::exportToJson. the error : Generating condition reports Error in jsonlite::fromJSON(file = treemapFile) : argument "txt" is missing, with no default is there any solution or some guide how to fix it.
Hi , is there any solution identified for the above problem ? Currently we are having same issue while generating report through Achilles .
I added a comment to the PR, I don't think the PR addresses this since you can't remove file =
and have the value passed in as the first param (the json text) and have it just work.
Secondly, there is no parameter named 'txt' in the function signature of jsonlite::fromJSON()
I think this error is from somewhere else.
We need the full stack trace to know what the exact line is that is reporting the error. the message Calls: exportToJson -> generateConditionReports -> <Anonymous>
gives us some info, but we need to know where the <Annonymous>
call is
The full stack trace:
traceback() 3: jsonlite::fromJSON(file = treemapFile) 2: generateConditionReports(conn, connectionDetails$dbms, cdmDatabaseSchema, resultsDatabaseSchema, outputPath, vocabDatabaseSchema) 1: exportToJson(connectionDetails, cdmDatabaseSchema = "omopcdm", resultsDatabaseSchema = "results", vocabDatabaseSchema = "omopcdm", outputPath = "/exportToJson", compressIntoOneFile = FALSE)
and signature of jsonlite::fromJSON(), package version 1.8.8
jsonlite::fromJSON function (txt, simplifyVector = TRUE, simplifyDataFrame = simplifyVector, simplifyMatrix = simplifyVector, flatten = FALSE, ...)
As @Blappchri pointed out in #743, this is because we're calling jsonlite::fromJSON
using rjson::fromJSON
's signature
fromJSON( json_str, file, method = "C", unexpected.escape = "error", simplify = TRUE )
fromJSON( txt, simplifyVector = TRUE, simplifyDataFrame = simplifyVector, simplifyMatrix = simplifyVector, flatten = FALSE, ...)
Since the PR hasn't been reviewed yet, I removed the Achilles from my HADES instance and installed @ziporah 's #743. But I still got the same error. Am I missing something?
Note that the branch isn't mine, @ziporah developed it. I am just the one being annoying about getting this issue fixed^^. I have not verified myself that the branch works in its entirety, but based on the code it is fixing the thing that need to be changed. I myself have used a workaround based on using trace() to rewrite the fromJSON function to how Achilles assumes it works within my R session.
Sorry for the confusion, I edited my comment
We are getting the same error :( I am unable to find the function exportToJson.R inside Achilles package directory to make the edits per PR. Any thoughts on this?
When running the latest version of Achilles, v1.7.2:
I believe this is a regression caused in https://github.com/OHDSI/Achilles/commit/de786a64f107bf9ab289e81d6154191072aea684 since the jsonlite
fromJSON
function definition requires a parameter calledtxt
(which apparently can be a URL or file path as well): https://github.com/jeroen/jsonlite/blob/7287acf3925392c33b523c76dedd5fed631971a3/R/fromJSON.R#L44.I could find the following 4 instances of
fromJSON
using GitHub's search: https://github.com/search?q=repo%3AOHDSI%2FAchilles%20fromJson&type=codeWith https://github.com/OHDSI/Broadsea-Atlasdb it might be possible to create a basic integration test for running Achilles against a DB as part of the CI?