moritz
02/20/2023, 8:29 PMNamedTuple
class called TableInfo
and created an asset that should return a list of them.
@asset
def tables() -> list[TableInfo]:
I get the following error:
dagster._core.errors.DagsterInvalidDefinitionError: Invalid type: dagster_type must be an instance of DagsterType or a Python type: got list[TableInfo].
I don't see why it shouldn't work. Is this a known limitation or am I doing something wrong?Rasmus Bonnevie
02/21/2023, 9:36 AMAssetsDefinition
instance, I think the type hints are parsed programmatically to link into Dagster's typing and validation functionality (https://docs.dagster.io/concepts/types). So it only accepts Dagster types, which is also what the message is saying. I believe you can make custom ones, but I honestly haven't really made use of it yet.moritz
02/21/2023, 9:38 AMRasmus Bonnevie
02/21/2023, 9:38 AMRasmus Bonnevie
02/21/2023, 9:39 AMtyping
maybe?moritz
02/21/2023, 9:40 AMmoritz
02/21/2023, 9:41 AMRasmus Bonnevie
02/21/2023, 9:42 AMTableInfo
it might help? Just guessing at this point 😀moritz
02/21/2023, 9:43 AMop
with a single return value and that caused the error, too. So I don't think that's it.moritz
02/21/2023, 9:44 AMRasmus Bonnevie
02/21/2023, 9:44 AMmoritz
02/21/2023, 9:44 AMRasmus Bonnevie
02/21/2023, 9:47 AMmoritz
02/21/2023, 9:49 AMclaire
02/21/2023, 11:02 PMIsmael Rodrigues
02/23/2023, 11:45 PMIsmael Rodrigues
02/23/2023, 11:46 PM