-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pydantic v2 support #210
Comments
Alternative, and quickest fix:
|
Wouldn't work in my case, |
Same problem here, this issue is blocking me heavily since June 30th. |
I didn't notice that red-bird is also maintained by maintainer of this repo, |
I think it's up to @Miksus to decide if red-bird is "alive" or not Simply pin your pydantic version with |
Seems I have the similar issue when try intergrate to django followed https://rocketry.readthedocs.io/en/stable/cookbook/django.html
|
I have the same problem, the fix is ok, but for my project I loose all the benefit of pedantic 2.x |
I've started a PR to begin the work integrating pydantic V2 #212 Running locally with a basic 'hello_world' task at the moment, with pydantic 2.0.3 and I've installed @ManiMozaffar red-bird branch where .v1 has been appended to the pydantic imports for now. With Rocketry's dependence on that module, I think that is going to need migrating as well for this to work properly. |
Heads up: use pydantic migration module, so it’ll replace v1 codes with v2. Then 70 tests will fail and you need to start debugging them. Lots works as you mentioned, that’s why i decided to use it with .v1 because internally it doesn’t use pydantic alot, just as passing by arguments to tasks and etc so I didn’t see a great performance boost. |
Thanks for the heads up. |
Sorry for taking eternity to answer: I should upgrade my machine as developing Rocketry on it is painfully slow with it and have had too busy free time. I'll try to visit this in the week end (and hopefully purchase a new machine). |
Thanks @Miksus The way pydantic has changed has caused some odd class inheritance issues, One of the first things I've had to do is comment out creating the null session in the RedBase class in _base.py (Not an ideal solution)
This issue was also appearing with other classes further down but I managed to get around it by typing those variables to ClassVar based on a issue I found on the pydantic repo pydantic/pydantic#2410 (comment) This has been fine for getting the application running but when it comes to the test, because it uses DummyTask which inherits Task/FuncTask and then session is passed into it. This seemed to raise the exact same error as above. I've tried to get around this by setting ClassVar in the dummy class:
This then causes another error, where when it then tries to run the validation (on name inside the parse_name function) it doesn't seem to pass this attribute up the inheritance into the validation function. So you just end up getting a key error on the test.
All in all, I'm not sure what's changed in pydantic to cause that inheritance issue, but if anyone doesn't find a solution it's probably the last main issue with the PR and I can also reimplement the base class into the class structure. It would just need the rest of the warnings working through (But I think on the tests its inheriting a lot of those from RedBird). |
Just tried to do a quick fork of this (so I can get back to working) and change the |
Any progress on this? |
@johnsturgeon I did create a PR for RedBird also but as it stands I haven't managed to have time to work on it (over the last couple of weeks) and it still needs a lot of work. I would go as far to say that RedBird probably needs more work than the Rocketry stuff did lol. I'm hoping to try take a look at the RedBird PR this weekend, but I can't guarantee it will be done this weekend. Also when the PRs are done I'm not sure when time would be found to review the code and prep the merge. I'll try to keep people posted on the PR regardless |
Thank you for the update. It's not the end of the world atm (for me at least). The only thing it's holding up for me is an upgrade of a site from Flask to FastAPI (with pydantic 2.0 / beanie). Site still runs great, and I can wait. Cheers! |
In the meantime I'm leaning towards Celery. |
pydantic 2 will cause following bug:
|
thanks so much @Jypear i've cloned rocketry #212 and redbird #49 and integrated it at |
The only thing to be aware of in that fork is pickling isn't quite working yet (so multiprocess tasks are a bit hit and miss). Pydanticv2 seems to have completely borked it. |
Switch to using indexed timestamp as main scraping timestamp Added rocketry as dep which requires us to pin pydantic<2 because of Miksus/rocketry#210
Any progress..? |
@Yangeok It's waiting on maintainer still. |
+1 here. I just looked at this library and wanted to use it in my FastAPI application (depends on Pydantic v2.0). What a bummer. It looked quite nice... |
this project seems inactive now |
Update to everyone: Rocketry seems to not be maintained anymore. |
Update: Rocketry seems to not be maintained anymore.
If you're looking for an alternative with supporting pydantic v2, try out AioClock.
https://github.com/ManiMozaffar/aioclock
Is your feature request related to a problem? Please describe.
The problem is that you're using red-bird for logging which is large code base, and also rocketry is dependent on v1.
Describe the solution you'd like
Describe alternatives you've considered
None
Additional context
None
The text was updated successfully, but these errors were encountered: