Skip to content

Commit

Permalink
Merge 0836731 into 2de028b
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwoerpel committed Nov 5, 2023
2 parents 2de028b + 0836731 commit a3e9ae8
Show file tree
Hide file tree
Showing 2 changed files with 237 additions and 94 deletions.
6 changes: 4 additions & 2 deletions investigraph/model/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def stream(self) -> bool:
can = self.mimetype in STREAM_TYPES
if wants is None:
return can
return wants and can
return bool(wants and can)

def _resolve_head(self) -> None:
if self.head is None:
Expand All @@ -54,7 +54,9 @@ def _resolve_head(self) -> None:
def _resolve_http(self) -> None:
if self.response is None:
self._resolve_head()
self.source.stream = self.source.stream or self.head.can_stream()
if self.source.stream is None:
if self.mimetype == types.CSV:
self.source.stream = self.head.can_stream()
res = requests.get(self.source.uri, stream=self.source.stream)
assert res.ok
self.response = res
Expand Down
Loading

0 comments on commit a3e9ae8

Please sign in to comment.