Are assets run within a job not logged/materialize...
# ask-community
c
Are assets run within a job not logged/materialized in the Asset page? e.g. I have an asset-definition file
Copy code
from dagster import asset 

@asset
def asset1():
    return 100
and another job-file
Copy code
from dagster import job
from asset_file import asset1

@job
def sample_job():
    q = asset1()
Running the "sample_job" fails to materialize an entry in the Asset-page on dagster UI
Furthermore, if I include both the asset and the job in the same file e.g.
Copy code
from dagster import job, asset

@asset
def asset1():
    return 100

@job
def sample_job():
    q = asset1()
then asset1 disappears from the Asset-page on dagster-UI. It is because if we include both in the same file, then asset1 is treated like an "op", and hence not shown on the Asset page?
Any help is appreciated, thanks.
o
hi @Chang Hai Bin ! combining jobs and assets in that way is not supported. If you'd like to create a job that runs
asset1
, you would do that with
Copy code
from dagster import assset, define_asset_job, AssetSelection

@asset
def asset1():
    return 100

define_asset_job("my_job", selection=AssetSelection.assets(asset1))
👍 1