@@ -394,7 +394,7 @@ def get(
394
394
raise TypeError ("Must specify exactly one of id or name parameters" )
395
395
if not id :
396
396
id = f"{ storage_type } /{ Blob .namespace_id (namespace )} /{ name } "
397
- return super (cls , Blob ).get (id )
397
+ return super (cls , Blob ).get (id , client = client )
398
398
399
399
@classmethod
400
400
def get_or_create (
@@ -660,7 +660,7 @@ def download(self, file, range=None):
660
660
Parameters
661
661
----------
662
662
file : str or io.IOBase
663
- File or files to be uploaded. Can be string with path to the file in the
663
+ Where to write the downloaded blob. Can be string with path to the file in the
664
664
local filesystem, or an file opened for writing (``io.IOBase``). If a file like
665
665
object and already open, must be binary mode and writable. Open file-like
666
666
objects remain open on return and must be closed by the caller.
@@ -689,7 +689,6 @@ def download(self, file, range=None):
689
689
690
690
if isinstance (file , str ):
691
691
file = io .open (file , "wb" )
692
- close = True
693
692
elif isinstance (file , io .IOBase ):
694
693
close = file .closed
695
694
if close :
@@ -942,9 +941,6 @@ def delete_many(cls, ids, client=None):
942
941
:ref:`Spurious exception <network_exceptions>` that can occur during a
943
942
network request.
944
943
"""
945
- if client is None :
946
- client = CatalogClient .get_default_client ()
947
-
948
944
blob_delete = BlobDelete (ids = ids , client = client )
949
945
950
946
blob_delete .save ()
@@ -973,9 +969,9 @@ def _do_download(self, dest=None, range=None):
973
969
elif len (range ) == 2 :
974
970
range_str = f"bytes={ range [0 ]} -{ range [1 ]} "
975
971
else :
976
- ValueError ("invalid range value" )
972
+ raise ValueError ("invalid range value" )
977
973
else :
978
- ValueError ("invalid range value" )
974
+ raise ValueError ("invalid range value" )
979
975
980
976
headers ["range" ] = range_str
981
977
0 commit comments