Error SnowparkFetchDataException: (1406): Failed to fetch a Pandas Dataframe on AWS Linux EC2

I have my app successfully running on streamlit cloud, and locally, however when deploying on EC2 on AWS i’m getting the following error:

SnowparkFetchDataException: (1406): Failed to fetch a Pandas Dataframe. The error is: Cannot convert non-finite values (NA or inf) to integer

I’ve seen some articles to check PyArrow version - that’s latest (included below). I’m at a loss as to what might cause this on my newly deployed machine…

which streamlit
~/.local/bin/streamlit

python --version
Python 3.9.16

streamlit --version
Streamlit, version 1.31.0

All packages
Package Version


aiohttp 3.9.3
aiohttp-retry 2.8.3
aiosignal 1.3.1
altair 5.2.0
annotated-types 0.6.0
anyio 4.2.0
asn1crypto 1.5.1
async-timeout 4.0.3
attrs 20.3.0
aws-cfn-bootstrap 2.0
awscli 2.9.19
awscrt 0.16.7
Babel 2.9.1
bcrypt 4.1.2
blinker 1.7.0
cachetools 5.3.2
certifi 2024.2.2
cffi 1.14.5
chardet 4.0.0
charset-normalizer 3.3.2
chevron 0.13.1
click 8.1.7
cloud-init 22.2.2
cloudpickle 2.2.1
colorama 0.4.4
configobj 5.0.6
cryptography 41.0.7
dataclasses-json 0.6.4
dbus-python 1.2.18
distro 1.9.0
docutils 0.16
ec2-hibinit-agent 1.0.2
exceptiongroup 1.2.0
extra-streamlit-components 0.1.60
filelock 3.13.1
frozenlist 1.4.1
fuzzywuzzy 0.18.0
gitdb 4.0.11
GitPython 3.1.41
gpg 1.15.1
greenlet 3.0.3
h11 0.14.0
httpcore 1.0.2
httpx 0.26.0
idna 2.10
importlib-metadata 7.0.1
Jinja2 2.11.3
jmespath 0.10.0
jsonpatch 1.33
jsonpointer 2.0
jsonschema 3.2.0
langchain 0.1.5
langchain-community 0.0.17
langchain-core 0.1.18
langchain-experimental 0.0.50
langchain-openai 0.0.5
langchainhub 0.1.14
langsmith 0.0.86
Levenshtein 0.24.0
libcomps 0.1.18
lockfile 0.12.2
markdown-it-py 3.0.0
MarkupSafe 1.1.1
marshmallow 3.20.2
mdurl 0.1.2
multidict 6.0.5
mypy-extensions 1.0.0
netifaces 0.10.6
numexpr 2.9.0
numpy 1.26.4
oauthlib 3.0.2
openai 1.11.1
packaging 23.2
pandas 2.2.0
pillow 10.2.0
pip 24.0
platformdirs 3.11.0
ply 3.11
prettytable 0.7.2
prompt-toolkit 3.0.24
protobuf 4.25.2
pyarrow 15.0.0
pycparser 2.20
pydantic 2.6.1
pydantic_core 2.16.2
pydeck 0.8.1b0
Pygments 2.17.2
PyJWT 2.8.0
pyOpenSSL 23.3.0
pyrsistent 0.17.3
pyserial 3.4
PySocks 1.7.1
python-daemon 2.3.0
python-dateutil 2.8.2
python-Levenshtein 0.24.0
pytz 2022.7.1
PyYAML 5.4.1
rapidfuzz 3.6.1
regex 2023.12.25
release-notification 1.2
requests 2.31.0
rich 13.7.0
rpm 4.16.1.3
ruamel.yaml 0.16.6
ruamel.yaml.clib 0.1.2
selinux 3.4
sepolicy 3.4
setools 4.4.1
setuptools 59.6.0
six 1.15.0
smmap 5.0.1
sniffio 1.3.0
snowflake-connector-python 3.7.0
snowflake-snowpark-python 1.12.0
sortedcontainers 2.4.0
SQLAlchemy 2.0.25
streamlit 1.31.0
streamlit-authenticator 0.3.1
support-info 1.0
tabulate 0.9.0
tenacity 8.2.3
tiktoken 0.5.2
toml 0.10.2
tomlkit 0.12.3
toolz 0.12.1
tornado 6.4
tqdm 4.66.1
twilio 8.12.0
types-requests 2.31.0.6
types-urllib3 1.26.25.14
typing_extensions 4.9.0
typing-inspect 0.9.0
tzdata 2023.4
tzlocal 5.2
urllib3 1.25.10
validators 0.22.0
watchdog 3.0.0
wcwidth 0.2.5
wheel 0.42.0
yarl 1.9.4
zipp 3.17.0

Repo: github = /broepke/deadpool-app

(it didn’t let me post this)

Small update - this is a work around - but not what I was looking for - the offending column was one called AGE - I used dbt to coalesce the null values to zero

to_decimal(coalesce(pi.age, 0)) as age,

not exactly what I want - it was working locally and on the cloud. Any tips would still be greatly appreciated.

FYI - Age in SQL is defined as AGE NUMBER(38,0),