Hi! When we have an asset groups, what is the best...
# ask-community
a
Hi! When we have an asset groups, what is the best practice for defining it in a repository. Via a job or just the asset graph ? For e.g. Lets say we have the recommender_assets:
Copy code
@asset(group_name=RECOMMENDER)
def asset_1()

@asset(group_name=RECOMMENDER)
def asset_2(asset_1)
Copy code
story_recommender_job = define_asset_job("story_recommender_job"
, selection=AssetSelection.groups(RECOMMENDER))

all_jobs = [story_recommender_job]

@repository
def flows():
  return [ *all_jobs ]
Vs
Copy code
all_assets = [*recommender_assets]
@repository
def flows():
  return [ *all_assets ]
o
hi @Ashraf Shaik! when you
define_asset_job
, that AssetSelection is relative to all of the asset definitions that exist in the repository, so in your first example, that story_recommender_job actually would not contain any assets (as the assets don't exist in the repository, because they're not in the list returned from the flows function).
so short answer is that the second option would be correct 🙂
a
I see, Thank you @owen