Skip to content

Commit

Permalink
Fixes mypy error
Browse files Browse the repository at this point in the history
  • Loading branch information
catileptic committed Jul 27, 2023
1 parent 4874aa8 commit 9cf5829
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions followthemoney/mapping/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, query: "QueryMapping", data: Dict[str, Any]) -> None:
if database is None:
raise InvalidMapping("No database in SQL mapping!")
self.database_uri = cast(str, os.path.expandvars(database))
self.engine = create_engine(self.database_uri, poolclass=NullPool) # type: ignore
self.engine = create_engine(self.database_uri, poolclass=NullPool)
self.meta = MetaData()

tables = keys_values(data, "table", "tables")
Expand Down Expand Up @@ -121,4 +121,4 @@ def __len__(self) -> int:
q = self.apply_filters(q)
with self.engine.connect() as conn:
rp = conn.execute(q)
return int(rp.scalar())
return int(rp.scalar() or 0)

0 comments on commit 9cf5829

Please sign in to comment.