Skip to content

Commit

Permalink
deal with sql alchemy magic
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Prescod committed May 4, 2023
1 parent 3d95eb5 commit 77bc004
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions snowfakery/output_streams.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from abc import abstractmethod, ABC
import json
import sqlite3
from tempfile import TemporaryDirectory
import csv
import subprocess
Expand Down Expand Up @@ -329,7 +328,6 @@ def write_single_row(self, tablename: str, row: Dict) -> None:

def flush(self):
for tablename, (insert_statement, fallback_dict) in self.table_info.items():

# Make sure every row has the same records per SQLAlchemy's rules

# According to the SQL Alchemy docs, every dictionary in a set must
Expand Down Expand Up @@ -425,8 +423,7 @@ def _dump_db(self):
con = self.sql_db.engine.raw_connection()

# https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.iterdump
assert isinstance(con, sqlite3.Connection)
for line in con.iterdump():
for line in con.iterdump(): # type: ignore
assert self.text_output.stream
self.text_output.stream.write("%s\n" % line)

Expand Down

0 comments on commit 77bc004

Please sign in to comment.