Skip to content

Commit dd8dceb

Browse files
committed
removed empty test file
1 parent 1cc39e3 commit dd8dceb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

codeflash/api/cfapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import sys
66
from functools import lru_cache
77
from pathlib import Path
8-
from typing import TYPE_CHECKING, Any, Dict, Optional
8+
from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, List
99

1010
import requests
1111
import sentry_sdk
@@ -193,7 +193,7 @@ def get_blocklisted_functions() -> dict[str, set[str]] | dict[str, Any]:
193193
return {Path(k).name: {v.replace("()", "") for v in values} for k, values in content.items()}
194194

195195

196-
def is_function_being_optimized_again(owner: str, repo: str, pr_number: int, code_contexts: dict[str, str]) -> Dict:
196+
def is_function_being_optimized_again(owner: str, repo: str, pr_number: int, code_contexts: List[Dict[str, str]]) -> Dict:
197197
"""Check if the function being optimized is being optimized again."""
198198
response = make_cfapi_request(
199199
"/is-already-optimized",

codeflash/discovery/functions_to_optimize.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,7 @@ def check_optimization_status(functions_by_file: dict[Path, list[FunctionToOptim
491491
if not owner or not repo or pr_number is None:
492492
return []
493493

494-
code_contexts = {}
495-
path_to_function_map = {}
494+
code_contexts = []
496495

497496
for file_path, functions in functions_by_file.items():
498497
for func in functions:
@@ -529,7 +528,8 @@ def filter_functions(
529528
blocklist_funcs = get_blocklisted_functions()
530529
logger.debug(f"Blocklisted functions: {blocklist_funcs}")
531530
# Remove any function that we don't want to optimize
532-
already_optimized_paths = check_optimization_status(modified_functions)
531+
already_optimized_paths = check_optimization_status(modified_functions, project_root)
532+
533533

534534
# Ignore files with submodule path, cache the submodule paths
535535
submodule_paths = ignored_submodule_paths(module_root)
@@ -593,7 +593,7 @@ def filter_functions(
593593
functions_tmp = []
594594
for function in _functions:
595595
if (
596-
function.file_path.name,
596+
function.file_path,
597597
function.qualified_name,
598598
) in already_optimized_paths and random.random() > REPEAT_OPTIMIZATION_PROBABILITY:
599599
# This function is in blocklist, we can skip it with a probability

0 commit comments

Comments
 (0)