Giter Site home page Giter Site logo

Comments (2)

ramedina86 avatar ramedina86 commented on May 17, 2024 2

I've released version 0.1.10 which pins Pydantic to version 1.10.11 and thus solves the issue.

@SergeyPriem Thanks for reporting this

@martinmarroyo I really appreciate your help on this. As I wrote above, I decided to pin the Pydantic version for now.

The code you wrote seems to address the demands of Pydantic 2, but, as you noted, problems remain (an exception coming from the ASGI application).

I believe that this is a FastAPI issue. Pydantic v2 support was added in the latest version of FastAPI (0.100) and there appears to be some growing pains judging by discussions / issues on their repository. Thankfully, FastAPI decided to keep backwards compatibility with Pydantic v1 which allows to use the latest FastAPI while staying on Pydantic v1.

from streamsync.

martinmarroyo avatar martinmarroyo commented on May 17, 2024 1

Update

After some more research, I found that my issue was primarily caused by the new Pydantic update to version 2.0.2 last week. I fixed it temporarily by downgrading to version 1.10.11 (pip install pydantic==1.10.11). That should get things working as expected for now until a more permanent fix is put in place.


I ran into the same issue when installing streamsync 0.1.9 and running streamsync hello on Python 3.11. Here is the relevant documentation from Pydantic: https://docs.pydantic.dev/dev-v2/usage/errors/#typed-dict-version. This is breaking the streamsync command in general. I modified the imports in ss_types.py to check for the python version and import TypedDict based on that. Here is what I added to ss_types.py:

import sys
from typing import Any, Dict, List, Literal, Optional, Protocol, Tuple
# Python versions earlier than 3.12 need typing_extensions.TypedDict
if sys.version_info.major <= 3 and sys.version_info.minor < 12:
    from typing_extensions import TypedDict
else:
    from typing import TypedDict
from pydantic import BaseModel

It got the streamsync command to work, but now I'm getting validation errors when running streamsync hello.

I'd like to help with troubleshooting this further, but am admittedly a little lost with respect to collaboration on this project and how to build to test my changes. @ramedina86 I'm happy to help, please let me know if that's something you would like.

from streamsync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.