Is there a new recommended approach for testing a ...
# ask-community
t
Is there a new recommended approach for testing a sensor which yields
RunRequests
for an
UnresolvedAssetJobDefinition
(output of
define_asset_job()
or is this still the recommended approach?
My setup is like
Copy code
# get deployment name
    deployment_name = os.environ.get("ENV", "local")

    # get my resources
    resource_defs = RESOURCE_DEFS_BY_DEPLOYMENT[deployment_name]

    # get my assets
    sda_assets, source_assets, _ = assets_from_package_module(assets)

    # supply resources to the assets
    sda_with_resources = with_resources(sda_assets, resource_defs=resource_defs)

    # resolve the UnresolvedAssetJobDefinition
    resolved_job = my_job.resolve(
        assets=sda_with_resources,
        source_assets=source_assets,
    )
in order to use
validate_run_config()
properly and it feels a bit clunky
s
not sure this is that much better, but nowadays I would probably recommend
Copy code
job_def = Definitions(
    assets=...,
    jobs=[define_asset_job(...)],
    resources=...
).get_job_def("my_job_name")

validate_run_config(job_def, run_config=...)
👍 1