[PR #399/bbaee4fe backport][stable-1] Add missing psycopg2.extras import #405
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #399 as merged into main (bbaee4f).
SUMMARY
On some of our systems the
postgresql_querytask failed with the following error:Applying the patch from this commit fixed the issue for me on those systems. This was previously reported in issue #283. However now that some time has passed, I am unable to reproduce the issue on our newer systems.
In any case, this is still a mistake that could cause problems in the future, so I think it would be better to fix it.
The reason that this mistake is not causing any actual errors in normal situations is because of how the python import system functions: All of the entrypoints (all the source files under plugins/modules) have an import for
psycopg2.extras. This causesextrasto be available onpsycopg2for any code (in any module) that executes after that import statement, such as the function bodies inmodule_utils/postgres.py.ISSUE TYPE
COMPONENT NAME
community.postgresql
ADDITIONAL INFORMATION
Fixes #283