From fc6f610198e402ec81d65d366951815b17b0280b Mon Sep 17 00:00:00 2001 From: Paul Prescod Date: Fri, 5 Apr 2024 14:42:01 -0700 Subject: [PATCH] Make recent versions of pyright happy --- snowfakery/plugins.py | 10 +++++----- snowfakery/salesforce.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/snowfakery/plugins.py b/snowfakery/plugins.py index ad01ee7b..6b97808a 100644 --- a/snowfakery/plugins.py +++ b/snowfakery/plugins.py @@ -73,8 +73,8 @@ def __init__(self, interpreter): def custom_functions(self, *args, **kwargs): """Instantiate, contextualize and return a function library - Default behaviour is to return self.Function().""" - functions = self.Functions() + Default behaviour is to return self.Functions().""" + functions = self.Functions() # type: ignore functions.context = self.context return functions @@ -200,7 +200,7 @@ def resolve_plugins( with plugin_path(search_paths): plugins = [] for plugin_spec in plugin_specs: - plugins.extend(resolve_plugin(*plugin_spec)) + plugins.extend(resolve_plugin(*plugin_spec)) # type: ignore return plugins @@ -312,7 +312,7 @@ def __init_subclass__(cls, **kwargs): def _register_for_continuation(cls): - SnowfakeryDumper.add_representer(cls, Representer.represent_object) + SnowfakeryDumper.add_representer(cls, Representer.represent_object) # type: ignore yaml.SafeLoader.add_constructor( f"tag:yaml.org,2002:python/object/apply:{cls.__module__}.{cls.__name__}", lambda loader, node: cls._from_continuation( @@ -327,7 +327,7 @@ class PluginResultIterator(PluginResult): def __init__(self, repeat): self.repeat = repeat - def __iter__(self): + def __iter__(self) -> T.Iterator: return self def __next__(self): diff --git a/snowfakery/salesforce.py b/snowfakery/salesforce.py index 639397e8..0e76f726 100644 --- a/snowfakery/salesforce.py +++ b/snowfakery/salesforce.py @@ -22,7 +22,7 @@ def create_cci_record_type_tables(db_url: str): _populate_rt_table(connection, table, record_type_column, rt_table) -def _create_record_type_table(tablename: str, metadata: MetaData): +def _create_record_type_table(tablename: str, metadata: MetaData) -> Table: """Create a table to store mapping between Record Type Ids and Developer Names.""" rt_map_fields = [ Column("record_type_id", Unicode(18), primary_key=True),