in generator/explores/explore.py [0:0]
def get_datagroup(self) -> Optional[str]:
"""
Return the name of the associated datagroup.
Return `None` if there is no datagroup for this explore.
"""
if self.views_path and (self.views_path.parent / "datagroups").exists():
datagroups_path = self.views_path.parent / "datagroups"
datagroup_file = (
datagroups_path
/ f'{self.views["base_view"]}_last_updated.datagroup.lkml'
)
if datagroup_file.exists():
return f'{self.views["base_view"]}_last_updated'
return None