Skip to content

Commit

Permalink
Update to black's 2024 style
Browse files Browse the repository at this point in the history
  • Loading branch information
dseomn committed Feb 15, 2024
1 parent 0e0923e commit 3ff13d9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 31 deletions.
6 changes: 3 additions & 3 deletions rock_paper_sand/justwatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def __init__(
# preserved. NOTE: If this code is ever used in a long-running process,
# this might need more work to avoid stale data.
self._node_id_by_url_path: dict[str, str] = {}
self._node_by_id_by_country: (
dict[str, dict[str, Any]]
) = collections.defaultdict(dict)
self._node_by_id_by_country: dict[str, dict[str, Any]] = (
collections.defaultdict(dict)
)

def query(
self,
Expand Down
46 changes: 21 additions & 25 deletions rock_paper_sand/wikidata.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,18 @@ def __init__(
session: requests.Session,
) -> None:
self._session = session
self._entity_by_ref: (
dict[wikidata_value.EntityRef, wikidata_value.Entity]
) = {}
self._entity_classes: (
dict[wikidata_value.EntityRef, Set[wikidata_value.ItemRef]]
) = {}
self._forms_of_creative_work: (
dict[wikidata_value.ItemRef, Set[wikidata_value.ItemRef]]
) = {}
self._transitive_subclasses: (
dict[wikidata_value.ItemRef, Set[wikidata_value.ItemRef]]
) = {}
self._entity_by_ref: dict[
wikidata_value.EntityRef, wikidata_value.Entity
] = {}
self._entity_classes: dict[
wikidata_value.EntityRef, Set[wikidata_value.ItemRef]
] = {}
self._forms_of_creative_work: dict[
wikidata_value.ItemRef, Set[wikidata_value.ItemRef]
] = {}
self._transitive_subclasses: dict[
wikidata_value.ItemRef, Set[wikidata_value.ItemRef]
] = {}
self._related_media: dict[wikidata_value.ItemRef, RelatedMedia] = {}

def entity(
Expand Down Expand Up @@ -268,19 +268,15 @@ def related_media(self, item_ref: wikidata_value.ItemRef) -> RelatedMedia:
)
)
results = self.sparql(query)
item_classes: (
collections.defaultdict[
wikidata_value.ItemRef, set[wikidata_value.ItemRef]
]
) = collections.defaultdict(set)
item_forms: (
collections.defaultdict[
wikidata_value.ItemRef, set[wikidata_value.ItemRef]
]
) = collections.defaultdict(set)
items_by_relation: (
collections.defaultdict[str, set[wikidata_value.ItemRef]]
) = collections.defaultdict(set)
item_classes: collections.defaultdict[
wikidata_value.ItemRef, set[wikidata_value.ItemRef]
] = collections.defaultdict(set)
item_forms: collections.defaultdict[
wikidata_value.ItemRef, set[wikidata_value.ItemRef]
] = collections.defaultdict(set)
items_by_relation: collections.defaultdict[
str, set[wikidata_value.ItemRef]
] = collections.defaultdict(set)
for result in results:
related_item = wikidata_value.parse_sparql_term_item(
result["item"]
Expand Down
6 changes: 3 additions & 3 deletions rock_paper_sand/wikidata_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,9 +1206,9 @@ def test_filter(
api_entity_classes: Mapping[str, Set[wikidata_value.ItemRef]] = (
immutabledict.immutabledict()
),
api_forms_of_creative_work: (
Mapping[str, Set[wikidata_value.ItemRef]]
) = (immutabledict.immutabledict()),
api_forms_of_creative_work: Mapping[
str, Set[wikidata_value.ItemRef]
] = (immutabledict.immutabledict()),
api_related_media: Mapping[str, wikidata.RelatedMedia] = (
immutabledict.immutabledict()
),
Expand Down

0 comments on commit 3ff13d9

Please sign in to comment.