Skip to content

Commit

Permalink
Applied minor changes to azure PR
Browse files Browse the repository at this point in the history
  • Loading branch information
MSeal committed Dec 30, 2019
1 parent fc391e5 commit 2a9eb8d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
7 changes: 1 addition & 6 deletions papermill/abs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import re
import io

from six.moves import urllib

from azure.storage.blob import BlobServiceClient


Expand All @@ -19,9 +17,6 @@ class AzureBlobStore(object):
- write
"""

def __init__(self):
pass

def _blob_service_client(self, account_name, sas_token):

blob_service_client = BlobServiceClient(
Expand All @@ -46,7 +41,7 @@ def _split_url(self, url):
"account": match.group(1),
"container": match.group(2),
"blob": match.group(3),
"sas_token": urllib.parse.unquote_plus(match.group(4)),
"sas_token": match.group(4),
}
return params

Expand Down
8 changes: 4 additions & 4 deletions papermill/iorw.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ def read(self, path, extensions=['.ipynb', '.json']):
if path == '-':
return sys.stdin.read()

if not fnmatch.fnmatch(os.path.basename(path), '*.*'):
if not fnmatch.fnmatch(os.path.basename(path).split('?')[0], '*.*'):
warnings.warn(
"the file is not specified with any extension : " + os.path.basename(path)
)
elif not any(fnmatch.fnmatch(os.path.basename(path), '*' + ext) for ext in extensions):
elif not any(fnmatch.fnmatch(os.path.basename(path).split('?')[0], '*' + ext) for ext in extensions):
warnings.warn(
"The specified input file ({}) does not end in one of {}".format(path, extensions)
)
Expand All @@ -110,11 +110,11 @@ def write(self, buf, path, extensions=['.ipynb', '.json']):
return sys.stdout.write(buf.encode('utf-8'))

# Usually no return object here
if not fnmatch.fnmatch(os.path.basename(path), '*.*'):
if not fnmatch.fnmatch(os.path.basename(path).split('?')[0], '*.*'):
warnings.warn(
"the file is not specified with any extension : " + os.path.basename(path)
)
elif not any(fnmatch.fnmatch(os.path.basename(path), '*' + ext) for ext in extensions):
elif not any(fnmatch.fnmatch(os.path.basename(path).split('?')[0], '*' + ext) for ext in extensions):
warnings.warn(
"The specified input file ({}) does not end in one of {}".format(path, extensions)
)
Expand Down
2 changes: 1 addition & 1 deletion requirements-azure.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
azure-datalake-store >= 0.0.30
azure-storage-blob
azure-storage-blob >= 12.1.0
requests >= 2.21.0

0 comments on commit 2a9eb8d

Please sign in to comment.