-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing psycopg2.extras import #283
Comments
thanks for the report @Joris-van-der-Wel ! we'll look into this shortly. |
I'm looking into this and will reach back out with my findings. Thanks! |
Hi again @Joris-van-der-Wel, Just wondering, is there any reason in particular that you're using the Would you mind kindly trying with the Thanks! |
Hi, sorry for the late reply, Monday was a holiday. There is no particular reason for using I can verify that the error does not occur when using Do note that, if I change the query to something else, for example |
@Joris-van-der-Wel hello, thanks for reporting the issue!
I compared the imports in both the modules and there's nothing different between postgresql_ext and _query that could cause the error in the latter. So it's very strange:) Looking forward to your feedback |
Fixes #283 (cherry picked from commit bbaee4f) Co-authored-by: Joris <[email protected]>
SUMMARY
Attempting to use the task postgresql_query results in an exception "module 'psycopg2' has no attribute 'extras'".
ISSUE TYPE
COMPONENT NAME
postgresql_query
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Control host:
Debian Bullseye (debian:bullseye docker image)
python3, python3-pip, python3-psycopg2 (2.8.6) installed using apt
ansible installed using pip3 (ansible==5.7.1)
community.postgresql 2.1.5 installed using ansible-galaxy
Managed host:
Debian Buster (EC2 VM)
python3, python3-psycopg2 (2.7.7) installed using apt
STEPS TO REPRODUCE
EXPECTED RESULTS
Query is executed
ACTUAL RESULTS
It seems to me that an import for
psycopg2.extras
is missing in this file:community.postgresql/plugins/module_utils/postgres.py
Lines 19 to 22 in a7f68b8
And indeed if I execute the following, the problem goes away:
The text was updated successfully, but these errors were encountered: