Skip to content

Commit

Permalink
Adding ignoring statements for newer version of pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
jkasturi-sf committed Aug 14, 2023
1 parent 255a9f3 commit 088e6b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions snowfakery/salesforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def create_cci_record_type_tables(db_url: str):
engine = create_engine(db_url)
metadata = MetaData()
metadata.reflect(views=True, bind=engine)
with engine.connect() as connection, connection.begin():
for tablename, table in list(metadata.tables.items()):
with engine.connect() as connection, connection.begin(): # type: ignore
for tablename, table in list(metadata.tables.items()): # type: ignore
record_type_column = find_record_type_column(
tablename, table.columns.keys()
)
Expand All @@ -37,12 +37,12 @@ def _populate_rt_table(
):
column = getattr(table.columns, columnname)
query_res = connection.execute(select(column).where(column is not None).distinct())
record_types = [res[0] for res in query_res if res[0]]
record_types = [res[0] for res in query_res if res[0]] # type: ignore

if record_types:
insert_stmt = rt_table.insert()
rows = [
dict(zip(rt_table.columns.keys(), (rtname, rtname)))
dict(zip(rt_table.columns.keys(), (rtname, rtname))) # type: ignore
for rtname in record_types
]

Expand Down
2 changes: 1 addition & 1 deletion snowfakery/tools/mkdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class Plugin(BasePlugin):
config_scheme = (
("build_locales", mkdocs.config.config_options.Type(bool, default=False)),
("build_locales", mkdocs.config.config_options.Type(bool, default=False)), # type: ignore
)

def on_config(self, config):
Expand Down
4 changes: 2 additions & 2 deletions snowfakery/tools/snowbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def status(tempdir, num_records, num_records_tablename, progress_bar):
start = time()
sleep(2)
previous_count = 0
for i in range(1, 10 ** 20):
for i in range(1, 10**20):
sleep(1)
if i in (2, 5, 10, 20, 30, 45, 90, 150) or (i % 60 == 0):
print()
Expand Down Expand Up @@ -163,7 +163,7 @@ def count_database(filename, counts):
dburl = f"sqlite:///{filename}?mode=ro"
engine = create_engine(dburl)
insp = inspect(engine)
tables = insp.get_table_names()
tables = insp.get_table_names() # type: ignore
for table in tables:
counts[table] += count_table(engine, table)
return counts
Expand Down

0 comments on commit 088e6b6

Please sign in to comment.