Strange warning about SQL

Dear all,

It’s been a while I keep getting this warning anytime I submit a calculation:

SAWarning: Object of type <DbNode> not in session, add operation along 'DbUser.dbnodes' will not proceed 
(This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation.)

It seems it’s not really something to worry about, but I wanted to understand:

  1. Whether it is something that can be fixed
  2. If it is (sort of) bad
  3. In case, how to disable the warning

Thanks a lot for any pointer!

See the explanation in this PR: ORM: Filter inconsequential warnings from `sqlalchemy` by sphuber · Pull Request #6192 · aiidateam/aiida-core · GitHub
As well as the actual work around in the code: aiida-core/src/aiida/storage/psql_dos/orm/ at main · aiidateam/aiida-core · GitHub

Essentially the work around is to silence the warning by capturing it. Unfortunately, when you run pytest, this capture is undone, so you have to configure it again in pytest to capture it. See here: aiida-core/pyproject.toml at 9e3ebf6ea55d883c7857a1dbafe398b9579cca03 · aiidateam/aiida-core · GitHub

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.