Ansible running a query extracting a `time without time zone` object raises `TypeError: Value of unknown type: `

I am writing an ansible playbook.

I have the following task

- name: query on server_app - look for items_invoiced
  community.postgresql.postgresql_query:
    login_host: '{{ db_host }}'
    login_user: '{{ db_username }}'
    login_password: '{{ db_password }}'
    db: '{{ db_database }}'
    port: '{{ db_database_port }}'
    query: "{{ lookup('template', 'extract_items_invoiced__hourly.sql.j2') }}"

  register: items_invoiced

the content of extract_items_invoiced__hourly.sql.j2 is

select hour_payment, * from my_table

where my_table.hour_payment is a time without time zone object.

As the playbook runs, the following Traceback is raised

query on server_app - look for items_invoiced...
Using module file /home/my_user/var/NTTDATA/4store/ansible-venv/lib/python3.7/site-packages/ansible_collections/community/postgresql/plugins/modules/postgresql_query.py
Pipelining is enabled.
<10.133.4.100> ESTABLISH SSH CONNECTION FOR USER: my_user
<10.133.4.100> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/home/my_user/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="my_user"' -o ConnectTimeout=10 -o ControlPath=/home/my_user/.ansible/cp/a7034d48db 10.133.4.100 '/bin/sh -c '"'"'/usr/bin/python && sleep 0'"'"''
<10.133.4.100> (1, b'', b'Traceback (most recent call last):n  File "<stdin>", line 102, in <module>n  File "<stdin>", line 94, in _ansiballz_mainn  File "<stdin>", line 40, in invoke_modulen  File "/usr/lib/python2.7/runpy.py", line 188, in run_modulen    fname, loader, pkg_name)n  File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_coden    mod_name, mod_fname, mod_loader, pkg_name)n  File "/usr/lib/python2.7/runpy.py", line 72, in _run_coden    exec code in run_globalsn  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible_collections/community/postgresql/plugins/modules/postgresql_query.py", line 524, in <module>n  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible_collections/community/postgresql/plugins/modules/postgresql_query.py", line 520, in mainn  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 2200, in exit_jsonn  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 2193, in _return_formattedn  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 420, in remove_valuesn  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 397, in _remove_values_conditionsnTypeError: Value of unknown type: <type 'datetime.date'>, 2024-04-17n')
<10.133.4.100> Failed to connect to the host via ssh: Traceback (most recent call last):
  File "<stdin>", line 102, in <module>
  File "<stdin>", line 94, in _ansiballz_main
  File "<stdin>", line 40, in invoke_module
  File "/usr/lib/python2.7/runpy.py", line 188, in run_module
    fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible_collections/community/postgresql/plugins/modules/postgresql_query.py", line 524, in <module>
  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible_collections/community/postgresql/plugins/modules/postgresql_query.py", line 520, in main
  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 2200, in exit_json
  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 2193, in _return_formatted
  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 420, in remove_values
  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 397, in _remove_values_conditions
TypeError: Value of unknown type: <type 'datetime.date'>, 2024-04-17
The full traceback is:
Traceback (most recent call last):
  File "<stdin>", line 102, in <module>
  File "<stdin>", line 94, in _ansiballz_main
  File "<stdin>", line 40, in invoke_module
  File "/usr/lib/python2.7/runpy.py", line 188, in run_module
    fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible_collections/community/postgresql/plugins/modules/postgresql_query.py", line 524, in <module>
  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible_collections/community/postgresql/plugins/modules/postgresql_query.py", line 520, in main
  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 2200, in exit_json
  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 2193, in _return_formatted
  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 420, in remove_values
  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 397, in _remove_values_conditions
TypeError: Value of unknown type: <type 'datetime.date'>, 2024-04-17
  server_app failed: {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):n  File "<stdin>", line 102, in <module>n  File "<stdin>", line 94, in _ansiballz_mainn  File "<stdin>", line 40, in invoke_modulen  File "/usr/lib/python2.7/runpy.py", line 188, in run_modulen    fname, loader, pkg_name)n  File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_coden    mod_name, mod_fname, mod_loader, pkg_name)n  File "/usr/lib/python2.7/runpy.py", line 72, in _run_coden    exec code in run_globalsn  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible_collections/community/postgresql/plugins/modules/postgresql_query.py", line 524, in <module>n  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible_collections/community/postgresql/plugins/modules/postgresql_query.py", line 520, in mainn  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 2200, in exit_jsonn  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 2193, in _return_formattedn  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 420, in remove_valuesn  File "/tmp/ansible_community.postgresql.postgresql_query_payload_pOF_WY/ansible_community.postgresql.postgresql_query_payload.zip/ansible/module_utils/basic.py", line 397, in _remove_values_conditionsnTypeError: Value of unknown type: <type 'datetime.date'>, 2024-04-17n",
    "module_stdout": "",
    "msg": "MODULE FAILUREnSee stdout/stderr for the exact error",
    "rc": 1
}

So ansible is telling me that its python modules cannot recognize the datetime.date type

TypeError: Value of unknown type: <type 'datetime.date'>, 2024-04-17

could it be that there is a bug in the library?

Fot rhe moment, I have solved by casting the time without time zone to TEXT via sql

select hour_payment::text, * from my_table

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật