Skip to content

Commit

Permalink
fix: content-types
Browse files Browse the repository at this point in the history
  • Loading branch information
andy blair committed Oct 17, 2024
1 parent ac6a9ee commit ad06c22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nyx_extras/nyx_extras/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ def data_as_db(
log.debug("Not adding table for %s as no content was found", d.title)
continue
try:
if d.content_type == "csv":
if "csv" in d.content_type:
content = pd.read_csv(BytesIO(content), on_bad_lines="skip")
elif d.content_type in Parser._excel_mimes:
content = pd.read_excel(BytesIO(content))
elif d.content_type == "json":
elif "json" in d.content_type:
content = pd.read_json(BytesIO(content))
else:
log.warning("%s is unsupported type %s", d.title, d.content_type)
Expand Down

0 comments on commit ad06c22

Please sign in to comment.