Skip to content
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

Extracting model creation code #188

Open
nsheff opened this issue May 22, 2024 · 0 comments
Open

Extracting model creation code #188

nsheff opened this issue May 22, 2024 · 0 comments
Labels
question Further information is requested

Comments

@nsheff
Copy link
Contributor

nsheff commented May 22, 2024

I have another use case for which I'd like to create SQLModel/Pydantic models from JSON schema definitions.

We are doing that here in pipestat, but the code seems to be a little convoluted and integrated in with pipestat-specific things.

I'm wondering if we can extract this code into a modular function, so that I can do something like this:

# read json schema in from file into a dict
import json
my_dict = json.loads("path/to/schema.json")

# get model from this schema
MyModel = create_sqlmodel_from_dict(my_dict)

This is what I need and I feel like we already have built this functionality. What would it take to extract it so I can reuse it?

@donaldcampbelljr donaldcampbelljr added the question Further information is requested label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants