Achilles icon indicating copy to clipboard operation
Achilles copied to clipboard

Error in exportToAres() with duckdb output format

Open ganisimov opened this issue 1 year ago • 1 comments

When I run exportToAres() with outputFormat="duckdb", I see following error:

arguments imply differing number of rows: 1, 0

Here is log:

...
Connecting using Redshift driver
Generating Measurement reports
Generating Measurement reports
Connecting using Redshift driver
Error in data.frame(CONCEPT_ID = concept_id, CONCEPT_NAME = report$CONCEPT_NAME,  :
  arguments imply differing number of rows: 1, 0

This happens when concept_id is 0 and some other fields, like concept_name, are NAs. normalizeEmptyValue() replaces NAs with empty vectors and subsequent call to createConceptMedatataTable() tries to create data.frame out of concept_id of length 1 and the empty vectors.

Not sure if having concept_id 0 with empty concept_name is a valid situation. When running with JSON output format against the same data, no error is produced.

ganisimov avatar Feb 23 '24 07:02 ganisimov

Pushed fix to https://github.com/OHDSI/Achilles/pull/742

Mikhail-iontsev avatar Mar 04 '24 14:03 Mikhail-iontsev