OHDSI / ResultModelManager

RMM is an R package designed to handle common ohdsi results data management functions by providing a common API for data model migrations and definitions
https://ohdsi.github.io/ResultModelManager/
Apache License 2.0
3 stars 3 forks source link

DataMigrationManager calls SqlRender translation twice on same SQL #36

Closed schuemie closed 10 months ago

schuemie commented 10 months ago

First time: https://github.com/OHDSI/ResultModelManager/blob/main/R/DataMigrationManager.R#L252

Second time: https://github.com/OHDSI/ResultModelManager/blob/e513ba2d9bc4dbe6460b2f793628379cecd782ed/R/ConnectionHandler.R#L188

(via https://github.com/OHDSI/ResultModelManager/blob/main/R/DataMigrationManager.R#L258)

Calling translate on the same SQL twice can have unpredictable results. For this reason, SqlRender normally detects this and only translates it the first time, but this call to render removes the required attribute from the sql object.