https://dagster.io/ logo
#dagster-support
Title
# dagster-support
k

Katrin Grunert

08/23/2022, 1:17 PM
Hello! I have defined my own ConfigType Datetime a la https://dagster.slack.com/archives/C01U954MEER/p1637222307372200?thread_ts=1637172399.342200&cid=C01U954MEER, and in my config_schema, I defined a field like so:
Copy code
@op(
   config_schema={
      ...,
      'start_date': Field(
		  config=Array(Datetime())
	   ),
      ...
   }
)
which works and runs successfully, however I get the warning in my IDE (PyCharm):
Expected type 'type', got 'Datetime' instead
, which is a bit of a weird warning, as I got from the documentation that Array, Shape and similar expect ConfigTypes with simple types like Array(String), i get no warning I am wondering if that warning is a bug, or I am doing something wrong
z

Zach

08/23/2022, 3:28 PM
maybe try
Copy code
@op(
   config_schema={
      ...,
      'start_date': Field(
		  config=[Datetime()]
	   ),
      ...
   }
)
it seems to make the intellisense happy, not 100% sure Dagster will infer the type correctly though
c

chris

08/23/2022, 11:57 PM
I think that this is likely a bug - going to investigate, for now might be best to just mypy ignore
If you switch the outer type to
Noneable
instead of Array, for example, do you get the same warning? Or does it go away
k

Katrin Grunert

08/24/2022, 6:26 AM
@chris with Noneable it works indeed
@Zach the error is gone and the type also seems to be inferred correctly!
2 Views