OHDSI Home | Forums | Wiki | Github

The "invalid name for slot of class SQLiteConnection" error, and what to do about it

hades

(Martijn Schuemie) #1

Some of you may have already noticed this error when running the HADES packages:

invalid name for slot of class “SQLiteConnection”: extended_types

Technical explanation: The reason why this appears to be happening is because the latest version of RSQLite has added a field to the SQLiteConnection class. Multiple classes in HADES inherit from this class, and we discovered R has a weird habit of caching class definitions when installing packages. That means for example that the FeatureExtraction package, once installed, maintains a copy of the SQLiteConnection class definition. When the SQLiteConnection class is updated, for example because the new version of RSQLite is installed, the new and the cached version are out of sync, causing the error.

Solution: when the packages are reinstalled, the cache is recreated. So, after updating RSQLite, when this error starts to appear, reinstall those packages that introduce classes that inherit from SQLiteConnection:

# Uninstall the packages:
remove.packages(c("FeatureExtraction", "CohortMethod", "SelfControlledCaseSeries"))

# Reinstall the packages (remove any that you don't need):
remotes::install_github("ohdsi/FeatureExtraction")
remotes::install_github("ohdsi/CohortMethod")
remotes::install_github("ohdsi/SelfControlledCaseSeries")

CohortMethod run outof time
(Gowtham Rao) #2

Thank you @schuemie. This solves the issue the for me.


t