From 71abef74f542ae5832c070089a3be132859f7c27 Mon Sep 17 00:00:00 2001 From: pared Date: Wed, 7 Aug 2019 12:34:37 +0200 Subject: [PATCH] remote: azure: implement batch_exists --- dvc/remote/azure.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dvc/remote/azure.py b/dvc/remote/azure.py index 0b8330ae3..b94a67884 100644 --- a/dvc/remote/azure.py +++ b/dvc/remote/azure.py @@ -1,6 +1,7 @@ from __future__ import absolute_import from __future__ import unicode_literals +import itertools import os import re import logging @@ -154,3 +155,13 @@ class RemoteAZURE(RemoteBASE): path_info.bucket, path_info.path, sas_token=sas_token ) return download_url + + def batch_exists(self, path_infos, callback): + paths = [] + + for path_info in path_infos: + paths.append(self._list_paths(path_info.bucket, path_info.path)) + callback.update(str(path_info)) + + paths = set(itertools.chain.from_iterable(paths)) + return [path_info.path in paths for path_info in path_infos]