PIP-Technical-Team / pipapi

What the Package Does (One Line, Title Case)
https://pip-technical-team.github.io/pipapi/
Other
3 stars 0 forks source link

Use .onAttach instead of .onLoad ? #402

Closed shahronak47 closed 6 months ago

shahronak47 commented 7 months ago

Hi, For this PR #393 I am currently fixing all R CMD CHECK NOTES, warning and errors. I have finished almost all except couple of them.

I am getting following note :

checking R code for possible problems ... NOTE
  File 'pipapi/R/zzz.R':
    .onLoad calls:
      packageStartupMessage("Info: Disk based caching is enabled.")

  See section 'Good practice' in '?.onAttach'.

It seems .onLoad and packageStartupMessage don't get along well and if we want to use packageStartupMessage we need to do it in .onAttach for this NOTE to disappear.

So my question is, is it ok to change this .onLoad function to .onAttach ? Will it impact anything?

reference - https://forum.posit.co/t/when-to-use-onload-vs-onattach/21953

@tonyfujs @randrescastaneda what do you think?

tonyfujs commented 6 months ago

Sorry for the delay in responding @shahronak47 . Please keep it as is. We try to change it in the past, and it caused issues when deploying the API through the docker container. I've never understood exactly why, but I just remember it caused issues. Thanks!