Skip to content

Commit

Permalink
HARMONY-1929: Lint cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnyinverso committed Nov 21, 2024
1 parent 9d6f685 commit a19fcd0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions harmony/harmony.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,13 +1317,14 @@ def _download_file(self, url: str, directory: str = '', overwrite: bool = False)
parse_result = parse.urlparse(url)
is_opendap = parse_result.netloc.startswith('opendap')
method = 'post' if is_opendap else 'get'
if is_opendap: # remove the query params from the URL and convert to dict
if is_opendap: # remove the query params from the URL and convert to dict
new_url = parse.urlunparse(parse_result._replace(query=""))
data_dict = dict(parse.parse_qsl(parse.urlsplit(url).query))
headers = {
"Accept-Encoding": "identity"
}
with getattr(session, method)(new_url, data=data_dict, stream=True, headers=headers) as r:
with getattr(session, method)(
new_url, data=data_dict, stream=True, headers=headers) as r:
with open(filename, 'wb') as f:
shutil.copyfileobj(r.raw, f, length=chunksize)
if verbose and verbose.upper() == 'TRUE':
Expand Down

0 comments on commit a19fcd0

Please sign in to comment.