https://dagster.io/ logo
#ask-community
Title
# ask-community
m

Martin O'Leary

08/17/2022, 1:44 PM
Hey folks 👋 This time I'm looking for help with
dagster-pandera
If I have an
Asset
defined which takes in a DataFrame and returns a DataFrame can I have dagster type check the input? I know by using
pandera_schema_to_dagster_type
on a pandera schema model and supplying that to the
dagster_type
arg of the
asset
call dagster will check the output but how do I correctly annotate (and validate the schema of) the input? If I use the same type as I supply to
dagster_type
to annotate the input in the function signature I start to get all sorts of warnings that the type doesn't have any of the usual pandas df methods (
sort_values
etc) The example in the docs doesn't have an input defined so I'm not sure how I can get this schema validation on the input
🤖 1
s

sandy

08/17/2022, 4:57 PM
Hey @Martin O'Leary - it's an oversight that we don't have a straightforward way to do this. This PR should remedy: https://github.com/dagster-io/dagster/pull/9410. You'll be able to supply a dagster type on an
AssetIn
.
m

Martin O'Leary

08/17/2022, 5:42 PM
Brilliant @sandy - thank you!