mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-23 07:58:22 +00:00
fix(csv-enricher): Add HTTP status code checking for remote file fetches (#15454)
This commit is contained in:
parent
d9fc440c5f
commit
7af6063bf3
@ -632,6 +632,7 @@ class CSVEnricherSource(Source):
|
|||||||
if parsed_location.scheme in ("http", "https"):
|
if parsed_location.scheme in ("http", "https"):
|
||||||
try:
|
try:
|
||||||
resp = requests.get(self.config.filename)
|
resp = requests.get(self.config.filename)
|
||||||
|
resp.raise_for_status() # Raise an exception for HTTP error status codes
|
||||||
decoded_content = resp.content.decode("utf-8-sig")
|
decoded_content = resp.content.decode("utf-8-sig")
|
||||||
rows = list(
|
rows = list(
|
||||||
csv.DictReader(
|
csv.DictReader(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user