snowflake-connector-python: SNOW-1004188: Python cannot import name 'Mapping' from 'collections'

Python version

3.12

Operating system and processor architecture

Linux-6.5.11-linuxkit-x86_64-with-glibc2.34

Installed packages

awslambdaric==2.0.8
boto3==1.28.72
botocore==1.31.72
jmespath==1.0.1
python-dateutil==2.8.2
s3transfer==0.7.0
simplejson==3.17.2
six==1.16.0
urllib3==1.26.17
sh-5.2# 
sh-5.2# python -m pip3 freeze
/var/lang/bin/python: No module named pip3
sh-5.2# pip freeze --path .
anyio==4.2.0
asn1crypto==0.24.0
azure-common==1.1.28
azure-core==1.29.6
azure-storage-blob==12.19.0
boto3==1.9.253
botocore==1.12.253
certifi==2023.11.17
cffi==1.16.0
charset-normalizer==3.3.2
cryptography==41.0.7
docutils==0.15.2
future==0.18.3
idna==3.6
ijson==3.2.3
isodate==0.6.1
Jinja2==3.1.2
jmespath==0.10.0
MarkupSafe==2.1.3
pycparser==2.21
pycryptodomex==3.20.0
PyJWT==2.8.0
pyOpenSSL==23.3.0
python-dateutil==2.8.2
pytz==2023.3.post1
requests==2.31.0
s3transfer==0.2.1
six==1.16.0
sniffio==1.3.0
snowflake-connector-python==1.9.1
typing_extensions==4.9.0
urllib3==1.25.11

What did you do?

Using a docker container to create a lambda layer for a function. Our current function is in 3.8 and going to be deprecated soon. Would be nice to be able to update it to the latest python version. We can move to 3.9 but would like to use some features in 3.11/3.12

What did you expect to see?

Layer usage but instead get the following error cannot import name ‘Mapping’ from ‘collections’

Can you set logging to DEBUG and collect the logs?

import logging
import os

for logger_name in ('snowflake.connector',):
    logger = logging.getLogger(logger_name)
    logger.setLevel(logging.DEBUG)
    ch = logging.StreamHandler()
    ch.setLevel(logging.DEBUG)
    ch.setFormatter(logging.Formatter('%(asctime)s - %(threadName)s %(filename)s:%(lineno)d - %(funcName)s() - %(levelname)s - %(message)s'))
    logger.addHandler(ch)

About this issue

  • Original URL
  • State: open
  • Created 6 months ago
  • Comments: 16

Most upvoted comments

Reply no I haven’t - still on 3.9 and upgrading all our snowflake lambdas to 3.9 from 3.8 before the depreciation date