Hello, I'm currently defining the different assets...
# ask-community
j
Hello, I'm currently defining the different assets based on a meta table (in this chat, this approach is also called an asset generator). This works all fine. Now I want to split those assets into new groups based on some conditions which overwrite the groups definied in the asset generator. For example: Some assets are put on inactive so I want to make an asset group with all the assets and their dependent assets which are inactive. Is their a way to combine for example load_assets_from_modules() and AssetSelection() in a new module?
s
Hey Joris - there's no built-in easy way to do this.
AssetsDefinition
has a
with_attributes
method that you can use to swap out the groups. If you have a specific API in mind that you'd like to see, mind filing a GH issue for it?
j
Thank you for the answer, is there any documentation around this?
Is it for example also a solution to have the following folder structure: • Assets/All_Assets ◦ Asset_factory.py ◦ init.py • Assets/Active_assets ◦ filter_active_assets.py ◦ init.py • Assets/Unactive_assets.py ◦ filter_unactive_assets.py ◦ init.py Thereafter I load_from_package_module the active and unactive assets and assign then a new group for the unactive assets. Assume I have a list of assets which needs to be deactivated. How can I then filter those assets out in filter_unactive_assets.py?