I'm using prefect on a gitlab CI and it was working fine until now when it had this error:
from pydantic import BaseModel, Field, SecretField
ImportError: cannot import name 'SecretField' from 'pydantic' (/usr/local/lib/python3.8/site-packages/pydantic/__init__.py)
I tought it was coming form a dependency issu but apparently not, I have compatible version (prefect==2.8.3 and pydantic==1.10.11).
Could come from another packages dependencies ? Here is my requirements.txt file I'm using to generate my docker image:
pandas==1.5.3
asyncpg==0.26.0
prefect==2.8.3
pydantic==1.10.11
simple_salesforce==1.12.3
snowflake-connector-python==3.0.3
snowflake-sqlalchemy==1.4.7
dbt-snowflake==1.4.2
beautifulsoup4==4.12.2
Where It could come from ?
SecretField
is not a class inpydantic
according to https://docs.pydantic.dev/1.10/usage/types/#secret-types. Perhaps, you want to useSecretStr
orSecretBytes
classes as shown below.