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

Nicolas Huray

04/24/2023, 7:35 PM
Other question I'm trying to test a partitioned job doing:
Copy code
cdi_id = "bnc_case"
    result = job.execute_in_process(run_config=(RunConfig(
        ops={
            "customer_data_extract": RuntimeConfig(cdi_id=cdi_id, datagen=DataGenConfig(add=10)),
        }
    )), partition_key=cdi_id)
c

chris

04/24/2023, 10:13 PM
Is the job that you’re doing this on defined using
define_asset_job
? If so, I don’t think we support
execute_in_process
for that - would instead recommend using
materialize
on the set of assets
n

Nicolas Huray

04/24/2023, 10:57 PM
@chris yes I defined the job with
define_asset_job
! What's the difference in this case between using
materialize
and
execute_in_process
?
(that's odd depending on how we initialize the job we have to use different ways to execute in memory for testing)
c

chris

04/24/2023, 11:07 PM
Yea honestly it’s not a perfect solution… I think the real ideal here is to have a
materialize
method on the
Definitions
object, or an
execute_in_process
method on
Definitions
. The split is between ops and assets, not in how you initialize the job. The key thing is that with asset jobs, you don’t actually know what the assets defined are until specified on the
Definitions
object, so you would have to provide the asset definitions when calling
execute_in_process
, which is awkward
n

Nicolas Huray

04/25/2023, 12:31 AM
@chris Got it ! Could you point me to an example using
materialize
?
2 Views