Skip to content

Commit

Permalink
Fixes for Binary Uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
smashedr committed Jul 1, 2024
1 parent 195ed50 commit 4a93ae8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zipline.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from decouple import config
from dotenv import find_dotenv, load_dotenv
from pathlib import Path
from typing import Any, Dict, List, Optional, TextIO
from typing import Any, Dict, List, Optional, TextIO, BinaryIO, Union


class ZipURL(object):
Expand Down Expand Up @@ -60,7 +60,7 @@ def __init__(self, base_url: str, **kwargs):
key = header.replace('_', '-').title()
self._headers[key] = str(value)

def send_file(self, file_name: str, file_object: TextIO,
def send_file(self, file_name: str, file_object: Union[BinaryIO, TextIO],
overrides: Optional[dict] = None) -> ZipURL:
"""
Send File to Zipline
Expand Down Expand Up @@ -198,7 +198,7 @@ def run() -> None:
if not os.path.isfile(name):
print(f'Warning: File Not Found: {name}')
continue
with open(name) as f:
with open(name, 'rb') as f:
# name, ext = os.path.splitext(os.path.basename(filename))
# ext = f'.{ext}' if ext else ''
# name = f'{name}-{gen_rand(8)}{ext}'
Expand Down

0 comments on commit 4a93ae8

Please sign in to comment.