Thomas
12/14/2022, 4:01 PMTraceback (most recent call last):
File "/Users/thomas/miniforge3/envs/datagenerator/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3433, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-22-26c8dc208c5a>", line 10, in <module>
ins={"num": In(EvenDagsterType)},
TypeError: 'list' object is not callable
jamie
12/14/2022, 8:32 PMlambda _, value: isinstance(value, int) and value % 2 == 0
Thomas
12/15/2022, 8:23 AMjamie
12/15/2022, 3:51 PMfrom dagster import op, DagsterType, In, Out, job, repository
EvenDagsterType = DagsterType(
name="EvenDagsterType",
type_check_fn=lambda _, value: isinstance(value, int) and value % 2 == 0,
)
@op
def two():
return 2
@op(
ins={"num": In(EvenDagsterType)},
out=Out(EvenDagsterType),
)
def double_even(num):
return num
@job
def my_job():
double_even(two())
@repository
def my_repo():
return [my_job]
and then loading up dagit and running the job from there. I’m also running latest version of dagsterThomas
12/21/2022, 12:47 PM