Skip to content

Commit

Permalink
Clean up imports and lint issues in latest ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
pudo committed Nov 15, 2023
1 parent 124db6e commit ad924ec
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion followthemoney/export/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def exportable_fields(
yield prop, proxy.get(prop)

def write(self, proxy: E, extra: Optional[List[str]] = None) -> None:
raise NotImplemented
raise NotImplementedError

def finalize(self) -> None:
pass
2 changes: 1 addition & 1 deletion followthemoney/export/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def write(self, proxy: E, extra: Optional[List[str]] = None) -> None:
headers.append(prop.label)
sheet = self.make_sheet(proxy.schema.plural, headers)
self.sheets[proxy.schema] = sheet
sheet = self.sheets.get(proxy.schema)
sheet = self.sheets[proxy.schema]
try:
cells = [proxy.id]
cells.extend(extra or [])
Expand Down
2 changes: 1 addition & 1 deletion followthemoney/export/rdf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
from typing import List, Optional, TextIO
from rdflib import Graph
from typing import List, Optional, TextIO

from followthemoney.export.common import Exporter
from followthemoney.proxy import E
Expand Down
2 changes: 1 addition & 1 deletion followthemoney/mapping/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import requests
from csv import DictReader
from urllib.parse import urlparse
from banal import keys_values, is_listish
from banal import keys_values
from typing import (
TYPE_CHECKING,
Any,
Expand Down
2 changes: 1 addition & 1 deletion followthemoney/mapping/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from followthemoney.proxy import EntityProxy
from followthemoney.mapping.property import PropertyMapping
from followthemoney.mapping.source import Record
from followthemoney.exc import InvalidData, InvalidMapping
from followthemoney.exc import InvalidMapping

if TYPE_CHECKING:
from followthemoney.model import Model
Expand Down
2 changes: 1 addition & 1 deletion followthemoney/mapping/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from followthemoney.helpers import inline_names
from followthemoney.exc import InvalidMapping
from followthemoney.proxy import EntityProxy
from followthemoney.util import get_entity_id, sanitize_text
from followthemoney.util import sanitize_text
from followthemoney.property import Property
from followthemoney.mapping.source import Record

Expand Down
2 changes: 1 addition & 1 deletion followthemoney/mapping/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, query: "QueryMapping", data: Dict[str, Any]) -> None:

@property
def records(self) -> Generator[Record, None, None]:
raise NotImplemented
raise NotImplementedError

def __len__(self) -> int:
return 0
2 changes: 1 addition & 1 deletion followthemoney/messages.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import yaml
from typing import Any, Dict, Generator, List, TextIO, Tuple, Union
from typing import Any, Dict, Generator, List, TextIO, Tuple

Message = Tuple[Any, Any, List[str], List[str]]

Expand Down
2 changes: 1 addition & 1 deletion followthemoney/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
the server without compromising isolation.
"""
import hmac
from typing import Any, Optional, Tuple, Union, TypeVar
from typing import Any, Optional, Tuple, Union

from followthemoney.types import registry
from followthemoney.proxy import E
Expand Down
3 changes: 2 additions & 1 deletion followthemoney/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from followthemoney.types.number import NumberType
from followthemoney.types.common import PropertyType


registry = Registry()
registry.add(UrlType)
registry.add(NameType)
Expand All @@ -45,3 +44,5 @@
registry.add(HTMLType)
registry.add(StringType)
registry.add(NumberType)

__all__ = ["PropertyType", "registry"]
1 change: 0 additions & 1 deletion followthemoney/types/identifier.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import re
from typing import Callable, Sequence

from followthemoney.types.common import PropertyType
from followthemoney.util import dampen, shortest, longest
Expand Down

0 comments on commit ad924ec

Please sign in to comment.