Clinical-Genomics / housekeeper

File data orchestrator
MIT License
2 stars 0 forks source link

Split get_files_before into smaller functions #107

Closed seallard closed 1 year ago

seallard commented 1 year ago

Related to https://github.com/Clinical-Genomics/housekeeper/issues/105

    def get_files_before(
        self,
        bundle_name: str = None,
        tags: List[str] = None,
        before_date: dt.datetime = None,
    ) -> List[File]:
        """Fetch files before date from store"""
        query = self.get_files(tags=tags, bundle=bundle_name)
        if before_date:
            query = apply_version_filter(
                versions=self._get_join_version_query(query),
                filter_functions=[VersionFilters.FILTER_BY_DATE],
                before_date=before_date,
            )
        return query.all()