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

Pydantic datatype validation for hamilton nodes #473

Closed
elijahbenizzy opened this issue Oct 18, 2023 · 3 comments · Fixed by #1121
Closed

Pydantic datatype validation for hamilton nodes #473

elijahbenizzy opened this issue Oct 18, 2023 · 3 comments · Fixed by #1121
Assignees
Labels

Comments

@elijahbenizzy
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
We have pandera, we should have pydantic as well.

Describe the solution you'd like

class MyModel(BaseModel):
    ...
# mode 1
@check_output(schema=MyModel)
def foo() -> dict:
    ...

# mode 2
@h_pydantic.check_output_schema()
def foo() -> MyModel:
    ...

Describe alternatives you've considered

I, personally, find pydantic to be overkill for most cases and think the world should have united around dataclasses/typed dicts, separate from validation. That said, everyone uses it, so 🤷 .

Additional context
Related: #469

@skrawcz skrawcz added the good first issue Good for newcomers label Jul 18, 2024
@skrawcz
Copy link
Collaborator

skrawcz commented Jul 18, 2024

Task:

  • add some data validators that work like the pandera schema= one but for pydantic

@cswartzvi
Copy link
Contributor

cswartzvi commented Sep 1, 2024

@elijahbenizzy and @skrawcz - is this issue currently being worked on? If not, do you mind if I take a crack at it? Thanks!

@skrawcz
Copy link
Collaborator

skrawcz commented Sep 1, 2024

@cswartzvi go for it! You should be able to mirror the Pandera implementations I think. And if there's something structurally that could be better, let us know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants