Skip to content

Commit

Permalink
Small mypy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
calpaterson committed Aug 8, 2024
1 parent 239b442 commit 3b88f5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion csvbase/web/schemaorg.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ def to_dataset(table: Table) -> Mapping[str, Any]:
if table.has_caption():
obj["description"] = table.caption
# if we knew the table wasn't big we could refer to XLSX here:
distribution = []
for content_type in [ContentType.CSV, ContentType.PARQUET, ContentType.JSON_LINES]:
obj["distribution"].append(to_datadownload(table, content_type))
distribution.append(to_datadownload(table, content_type))
obj["distribution"] = distribution

return obj

Expand Down
4 changes: 2 additions & 2 deletions tests/test_seo.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def test_schemaorg_dataset(ten_rows):
actual = schemaorg.to_dataset(ten_rows)

# do the dates this way
assert datetime.fromisoformat(actual.pop("dateCreated")) == ten_rows.created
assert datetime.fromisoformat(actual.pop("dateModified")) == ten_rows.last_changed
assert datetime.fromisoformat(actual.pop("dateCreated")) == ten_rows.created # type: ignore
assert datetime.fromisoformat(actual.pop("dateModified")) == ten_rows.last_changed # type: ignore

# the rest must match:
assert expected == actual

0 comments on commit 3b88f5d

Please sign in to comment.