Pydantic-resolve, a hierarchical solution for data fetching and processing
1–10 of 16 posts
Re: Pydantic-resolve, a hierarchical solution for data fetching and processing
#2based on pydantic, pydantic-resolve uses declaretive way to define and resolve (fetch) data from top to bottom
and provides post-process hooks from bottom to top (friendly for aggregation & calculation)
it also provides visibility control over all fields.
concept diagram: https://raw.githubusercontent.com/allmonday/pydantic-resolve...
Re: Pydantic-resolve, a hierarchical solution for data fetching and processing
#3however gql itself only walks from top to bottom, which lack the ability to change data after it's descdenants are resolved.
pydantic-resolve is progressive, this means you don't need to introduce a big framework to build a nested view data, all you need to do is just:
- simpilify your query of root data (no complex sql any more, then you can reuse it)
- define the related data you wanted, and then let resolver to fetch it.
that's all~
Re: Pydantic-resolve, a hierarchical solution for data fetching and processing
#4inspired by graphql (define schema in declaretive way) however gql itself only walks from top to bottom, which lack the ability to change data after it's descdenants are resolved. pydantic-resolve is progressive, this means you don't need to introduce a big framework to build a nested view data, all you need to do is just: - simpilify your query of root data (no complex sql any more, then you can reuse it) - define t…
Re: Pydantic-resolve, a hierarchical solution for data fetching and processing
#5Re: Pydantic-resolve, a hierarchical solution for data fetching and processing
#6Re: Pydantic-resolve, a hierarchical solution for data fetching and processing
#7Re: Pydantic-resolve, a hierarchical solution for data fetching and processing
#8I’ve used Pydantic with FastAPI, but can’t really get a solid feel for what this is doing. Can someone explain this to me like I’m 5?
it's expensive to fetch profile_image since it will involve a http call to profile_image_url. right now, i would resolve this by using the @property decorator
this library offers an alternative method for populating profile_image by explicitly giving the user a hook for when they want to resolve this dependency. they might want to do it before access time, they might want to batch requests to this external profile_image service to reduce roundtrip latency
this pattern has potential to become more powerful if we only have user_id in context initially. we might want to fetch the product_image_url from the database then fetch the actual product_image after. this dependency graph might be simplified/optimized using this tool
the repo provides its own concrete example of this form with batch_person_age_loader
Re: Pydantic-resolve, a hierarchical solution for data fetching and processing
#9I’ve used Pydantic with FastAPI, but can’t really get a solid feel for what this is doing. Can someone explain this to me like I’m 5?
say you have a model with two attributes profile_image_url: str and profile_image: bytes it's expensive to fetch profile_image since it will involve a http call to profile_image_url. right now, i would resolve this by using the @property decorator this library offers an alternative method for populating profile_image by explicitly giving the user a hook for when they want to resolve this dependency. they might want t…
Re: Pydantic-resolve, a hierarchical solution for data fetching and processing
#10Could this be used to efficiently model an hierichical comment thread for example, like HN or reddit?
This project might be helpful in fetching the actual content from a database in an efficient way.