@classmethod
def get_affected_assets(cls, session, asset_key):
    """Get information about assets affected by a change in parent's state

        Args:
            session: database session
            asset_key(int): key of the updated asset
        
        Returns:
            tuple: consisting of 3 (optional) items: 1) child assets that are powered by the updated asset
                                                     2) parent(s) of the updated asset
                                                     3) second parent of the child assets  
        """
    results = session.run(
        """
            OPTIONAL MATCH  (parentAsset:Asset)<-[:POWERED_BY]-(updatedAsset { key: $key }) 
            OPTIONAL MATCH (nextAsset:Asset)-[:POWERED_BY]->({ key: $key }) 
            OPTIONAL MATCH (nextAsset2ndParent)<-[:POWERED_BY]-(nextAsset) 
            WHERE updatedAsset.key <> nextAsset2ndParent.key 
            RETURN collect(nextAsset) as childAssets, collect(parentAsset) as parentAsset, nextAsset2ndParent
            """
        , key=asset_key)
    list_of_dicts = lambda r: list(map(dict, list(r)))
    record = results.single()
    return list_of_dicts(record['childAssets']) if record['childAssets'
        ] else list(), list_of_dicts(record['parentAsset']) if record[
        'parentAsset'] else list(), dict(record['nextAsset2ndParent']
        ) if record['nextAsset2ndParent'] else None
