def get_projects_to_fetch()

in common/big_query/big_query_adapter.py [0:0]


    def get_projects_to_fetch(self) -> list[str]:
        """
        Retrieves a list of project IDs to fetch from the projects table.
        """
        table_ref = f"{self._project}.{self._dataset_name}.projects"
        target_creation_date = self._get_target_creation_date(table_ref)
        if not target_creation_date:
            error_message = (
                "Unable to identify the most recent data "
                f"partition in table: {table_ref}."
            )
            logger.error(
                "Failed to identify recent data partition for table %s. %s",
                table_ref,
                error_message,
            )
            raise BigQueryDataRetrievalError(error_message)

        project_ids_query_job = self._execute_query(
            table_ref, target_creation_date, "projectId"
        )

        project_ids = [
            project_id.projectId
            for project_id in project_ids_query_job.result()
        ]
        return project_ids