https://dagster.io/ logo
#ask-community
Title
# ask-community
c

Chaitya

04/10/2023, 7:06 PM
Hey folks, I'm trying to do some testing using the new pythonic run configuration stuff. I used to be able to call my assets directly (with
build_op_context
) as described here. Now I get an error if I try to do that. Details in thread.
Before:
Copy code
@asset(run_config={"some": int, "inputs": str})
def my_asset():
    ...
After:
Copy code
def my_asset(context, inputs: SomeInputs):
    ...
Before:
Copy code
ctx = build_op_context(...)
my_asset(ctx)
After:
Copy code
inputs = SomeInputs(...)
my_asset(inputs)
The last line is the problem:
my_asset(inputs)
fails with:
Copy code
dagster._core.errors.DagsterInvalidInvocationError: Compute function of op 'my_asset' has context argument, but no context was provided when invoking.
if I specify the context too
Copy code
inputs = SomeInputs(...)
ctx = build_op_context(...)
my_asset(ctx, inputs)
it fails with:
Copy code
dagster._core.errors.DagsterInvalidInvocationError: Too many input arguments were provided for op 'my_asset'. This may be because an argument was provided for the context parameter, but no context parameter was defined for the op.
I can of course fall back to calling
materialize
, but I wanted to see if I was doing something wrong with just calling the asset function directly
b

ben

04/14/2023, 5:13 PM
Hi Chaitya, sorry to see you’re hitting this! This is one of the rough edges that we’re polishing down for the de-experimentalization of the feature for 1.3. We just shipped a fix for this which should be available with that release.
🙏 1
43 Views