You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defaz_file_url_to_query_components(url:str):
p=urlparse(url)
assertnotp.params, f"Invalid Params: {p.params}"assertnotp.fragment, f"Invalid Fragment: {p.fragment}"assertnotp.query, f"Invalid Params: {p.query}"netlocs=p.netloc.split('.')
assertlen(netlocs) ==5, f"Invalid netlocs: {p.netloc}: Not long enough"assertnetlocs[2:] == ['core','windows','net'], f"Invalid netlocs: {p.netloc} should end in core.windows.net"assertnetlocs[1] in ['blob','dfs'], f"Invalid netlocs: {p.netloc} should be one of blob/dfs"storage_account=netlocs[0]
_, container, *paths=p.path.split('/') #path starts with a / so p.path.split('/')[0] == ''file_path='/'.join(paths)
returndict(
storage_account=storage_account,
container=container,
file_path=file_path
)
And then query like
The text was updated successfully, but these errors were encountered: