Skip to content

Download ChEMBL schema files once per session#454

Merged
stitam merged 1 commit intoropensci:masterfrom
stitam:nulls
Feb 27, 2026
Merged

Download ChEMBL schema files once per session#454
stitam merged 1 commit intoropensci:masterfrom
stitam:nulls

Conversation

@stitam
Copy link
Copy Markdown
Contributor

@stitam stitam commented Feb 27, 2026

Related to #449.

There was an inconsistency issue between webservice requests and offline queries: when a value was missing from the respective database, the webservice often returned NULL but the offline query returned NA with the appropriate class (e.g. NA_character_). In PR #450 I implemented a fix in which we download a schema file from the ChEMBL resource and use that to replace NULL values with the appropriate NA values. However, downloading the schema with each query is inefficient.

This PR implements session level caching. When we load the package we create a new environment chembl_schema_cache. Whenever we need the schema file for a resource, we look for the schema in this environment. If we find it we use it, otherwise we download it and assign to the environment.

PR task list:

  • Update NEWS
  • Add tests (if appropriate)
  • Update documentation with devtools::document()
  • Check package passed

@stitam stitam added this to the 25-ISC-1-02-M1 milestone Feb 27, 2026
@stitam stitam merged commit e154c75 into ropensci:master Feb 27, 2026
7 checks passed
@stitam stitam deleted the nulls branch February 27, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant