Queenbee/pollination-streamlit dependency restriction on pydantic

Hello!

I was wondering if there are any plans for the pollination-streamlit/Queenbee libraries to support newer releases of pydantic?

The project I am working on uses schemas that rely on features released in pydantic 2.0.

I saw a PR that upgrades the dependency restriction from < 2.0 to <3.0 but there is a conflict that leads to this error:

  File "c:\Users\dsun_\repos\adaptis-tools\adaptis_tools\simulation\pollination_client.py", line 16, in <module>
    from pollination_streamlit.interactors import Job, NewJob, Recipe
  File "C:\Users\dsun_\repos\adaptis-tools\.venv\Lib\site-packages\pollination_streamlit\interactors.py", line 6, in <module>
    from queenbee.io.inputs.job import JobArgument, JobPathArgument
  File "C:\Users\dsun_\repos\adaptis-tools\.venv\Lib\site-packages\queenbee\io\inputs\job.py", line 6, in <module>
    from ..artifact_source import HTTP, S3, ProjectFolder
  File "C:\Users\dsun_\repos\adaptis-tools\.venv\Lib\site-packages\queenbee\io\artifact_source.py", line 9, in <module>
    from ..base.basemodel import BaseModel
  File "C:\Users\dsun_\repos\adaptis-tools\.venv\Lib\site-packages\queenbee\base\basemodel.py", line 143, in <modun <module>
    class BaseModel(BaseModelNoType):
  File "C:\Users\dsun_\repos\adaptis-tools\.venv\Lib\site-packages\queenbee\base\basemodel.py", line 146, in BaseModel
    type: constr(regex='^BaseModel$') = 'BaseModel'
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: constr() got an unexpected keyword argument 'regex'

Hi @dsoleil,

Unfortunately, we don’t have any immediate plans to upgrade to Pydantic 2.0. It is a huge undertaking as we have to do an upgrade in several libraries.

Can you be more specific here? We might be able to help you with achieving the same with Pydantic 1.0.

Thanks for the reply @mostapha, I understand that it is a very big undertaking. I can try to downgrade and adjust the code on our side.

More context:
We have created some schemas that use the decorators:

  • computed_field
  • field_validator
  • model_validator

which were introduced in pydantic 2.x, to validate some attributes. I found some alternatives in pydantic 1.x that I can use in place of these (found in their migration guide: Migration Guide - Pydantic).

If I go down this route, I can give an update here in case someone else has this issue.

1 Like