diff --git a/src/codemods/canonical/pivot_return_types/pivot_return_types.py b/src/codemods/canonical/pivot_return_types/pivot_return_types.py index 69fcda4db..95cec62fa 100644 --- a/src/codemods/canonical/pivot_return_types/pivot_return_types.py +++ b/src/codemods/canonical/pivot_return_types/pivot_return_types.py @@ -35,9 +35,9 @@ def f() -> FastStr: def execute(self, codebase: Codebase) -> None: # Iterate over all functions in the codebase for function in codebase.functions: - # Check if the function's return type annotation is 'BillPayVendor' + # Check if the function's return type annotation is 'str' if (return_type := function.return_type) and return_type.source == "str": - # Update the return type to 'Payee' + # Update the return type to 'FastStr' function.set_return_type("FastStr") # Add import for 'FastStr' if it doesn't exist diff --git a/src/codemods/canonical/rename_local_variables/rename_local_variables.py b/src/codemods/canonical/rename_local_variables/rename_local_variables.py index c18481e49..4eee8e192 100644 --- a/src/codemods/canonical/rename_local_variables/rename_local_variables.py +++ b/src/codemods/canonical/rename_local_variables/rename_local_variables.py @@ -42,7 +42,7 @@ def execute(self, codebase: Codebase) -> None: for file in codebase.files: for function in file.functions: # Check if any local variable names contain "position" - business_vendor_usages = function.code_block.get_variable_usages("position", fuzzy_match=True) - if len(business_vendor_usages) > 0: + position_usages = function.code_block.get_variable_usages("position", fuzzy_match=True) + if len(position_usages) > 0: # Rename function.rename_local_variable("position", "pos", fuzzy_match=True) diff --git a/src/codemods/canonical/swap_class_attribute_usages/swap_class_attribute_usages.py b/src/codemods/canonical/swap_class_attribute_usages/swap_class_attribute_usages.py index a7870250b..379348820 100644 --- a/src/codemods/canonical/swap_class_attribute_usages/swap_class_attribute_usages.py +++ b/src/codemods/canonical/swap_class_attribute_usages/swap_class_attribute_usages.py @@ -44,14 +44,14 @@ def execute(self, codebase: Codebase) -> None: # Add import of `CacheConfig` to function definition file function.file.add_symbol_import(class_b_symb) - # Check if the function body is using `bill_pay_vendor` + # Check if the function body is using `cache_config` if len(function.code_block.get_variable_usages(class_a_param.name)) > 0: # Add "wrapper" inside the function - # This creates the `business_vendor` variable internally + # This creates the `cache_config` variable internally proxy_var_declaration = f"""{class_a_param.name} = cache_config.settings # added by Codegen""" function.prepend_statements(proxy_var_declaration) - # Update all callsites of original function to take in `payee` instead of `bill_pay_vendor` + # Update all callsites of original function to take in `cache_config` instead of `graph_rag_config` fcalls = function.call_sites for fcall in fcalls: arg = fcall.get_arg_by_parameter_name(class_a_param.name)