Gabe Schine
03/06/2023, 11:26 PMDagsterType
and annotated the function return value for my @asset
definition. In the UI, the asset is being shown to return Any
, not my custom type.
Type definition
GeoJSONFeatureCollection = DagsterType(
name="GeoJSONFeatureCollection",
type_check_fn=is_geojson_feature_collection,
typing_type=Dict[str, Any],
)
Asset definition (abridged):
@asset(
...
)
def nifc_active_fire_perimeters_geojson(
context: OpExecutionContext,
) -> GeoJSONFeatureCollection:
...
Gabe Schine
03/06/2023, 11:27 PMdagster_type=GeoJSONFeatureCollection
, then the UI shows the correct type. I was expecting that the type inference code would be able to figure this out for me. Did I miss something?chris
03/07/2023, 1:12 AMchris
03/07/2023, 1:31 AMGeoJSONFeatureCollection
isn’t a valid annotation since it’s a variable, what you want to do is provide GeoJSONFeatureCollection
as the dagster_type
explicitly, then use the inner type Dict[str, Any]
as the annotationGabe Schine
03/07/2023, 2:43 AMchris
03/08/2023, 5:57 AM