Add explanation differentiating python types and dagster types


Add explanation differentiating python types and dagster types

related to - https://github.com/dagster-io/dagster/issues/4209

I think the simplest workflow involving dagster types is to never use them as annotations (especially now that we have this nice auto-conversion of type annotations to dagster types).

While enforcing this might break some people's existing code, I think putting a top-level, easily searchable warning on the Dagster Type page should help clarify the situation for people new to the Dagster Type system.

As a side note, I think the confusion around this issue lends support to the idea of prefering a list of type_check_fns (expectations?) on Ins/Outs rather than wrapping every expectation into a single DagsterType. Type annotations are super readable and ergonomic (and also encourage people to get static type checking for their code, which is nice), and it would be nice if the mental model was something more like "ok, now that I've annotated this function, python/dagster know what type this should be, so now let's add some more constraints in the Ins/Outs" (rather than "Ok I annotated my function so mypy can type check it, now let's create a dagster type so dagster can type check it and apply constraints").

Test Plan: bk

Reviewers: max, sandyryza, yuhan

Reviewed By: yuhan

Differential Revision: https://dagster.phacility.com/D8691


owenAuthored on Jul 2 2021, 8:38 PM
Differential Revision
D8691: Add explanation differentiating python types and dagster types
R1:d3b0a1573f77: update docs for sensor to reflect optional context