Vince van Noort
03/24/2022, 9:32 AM@op(
ins={"start": In(Nothing)},
out={"test_configuration": Out(TestConfiguration)},
required_resource_keys={"test_system"},
)
def setup_benchmark(context: OpExecutionContext) -> TestConfiguration:
....
@graph()
def run_experiment():
test_configuration = setup_benchmark()
It gives the following error:
error: Argument missing for parameter "context" (reportGeneralTypeIssues)
Any idea how i should fix this? 🙂jamie
03/24/2022, 1:48 PMsean
03/24/2022, 4:49 PMsetup_benchmark
inside run_experiment
, I’m seeing OpDefinition
, which is what I’d expect. This has a __call__
method with signature:
python
def __call__(self, *args, **kwargs) -> Any
So it makes sense that I’m not seeing the error (there’s no enforcement of context
here). Are you sure you’ve shown the right line triggering the error? Also, are you using recent versions of dagster and pyright?
And just curious, how are you getting pyright to read dagster
? Did you turn useLibraryCodeForTypes
on, or did you add dagster
to pyright’s extraPaths
?Vince van Noort
03/25/2022, 8:19 AMVince van Noort
03/25/2022, 8:25 AM[tool.pyright]
reportMissingImports = false
reportMissingTypeStubs = false
reportUnknownMemberType = false
reportUnusedImport = false
useLibraryCodeForTypes
is not turned on, and i have not added dagster
to pyrights extraPaths
.
Is that something I should do?Vince van Noort
03/25/2022, 8:40 AMVince van Noort
03/25/2022, 8:41 AMpoetry install
inside the folderVince van Noort
03/25/2022, 8:41 AMpoetry run pyright .
Vince van Noort
03/25/2022, 8:41 AMVince van Noort
03/25/2022, 8:42 AMfrom dagster import In, Nothing, OpExecutionContext, graph, job, op
@op(
ins={"start": In(Nothing)},
)
def start_test(context: OpExecutionContext) -> None:
pass
@job
def run_job_test():
start_test()
@graph
def run_graph_test():
start_test()
if __name__ == "__main__":
run_graph_test.to_job().execute_in_process()
run_job_test.execute_in_process()
Vince van Noort
03/25/2022, 8:42 AM/Users/vincevannoort/Projects/dagster-typing-test/dagster_typing_test/repo.py:11:5 - error: Argument missing for parameter "context" (reportGeneralTypeIssues)
/Users/vincevannoort/Projects/dagster-typing-test/dagster_typing_test/repo.py:16:5 - error: Argument missing for parameter "context" (reportGeneralTypeIssues)
Vince van Noort
03/25/2022, 8:42 AMVince van Noort
03/25/2022, 8:43 AMVince van Noort
03/29/2022, 7:33 AM