is there a way to make a python class decorated wi...
# announcements
d
is there a way to make a python class decorated with
@usable_as_dagster_type
have
required_resource_keys
?
p
that’s interesting… is there a specific example of when you would need those resources to be initialized?
d
yeah. I could be making this more complicated than it needs to be so lmk what you think. I'm creating a
SnowflakeRelation
class that will house some useful properties/methods for snowflake objects (fully qualified object decomposition,
exists()
and
size()
methods, etc.) Ideally, I'd like to leverage the already existing
snowflake
resource to run the queries contained within the methods
p
I think the default
required_resource_keys
on custom dagster types are resources that need to be initialized in the type check function
d
ideally I'd be able to use
SnowflakeRelation
as a dagster type for solid I/O
p
but the
usable_as_dagster_type
just uses the python
isinstance
call for type checking
Separately, the custom input hydration / output materialization / auto-plugin functions that are used with custom types have their own
required_resource_keys
which I believe might be the hooks you want to use for solid I/O
It’s using
PythonObjectDagsterType
instead of the decorator, but it’s the same idea
but let me know if I’m missing the mark somewhere, and there’s a different use case you’re trying to capture
d
awesome - let me check this out and circle back. Thanks @prha!