@@ -278,25 +278,12 @@ def _get_validation_errors(
278
278
linter_errors = validate (path , function_name , validators )
279
279
return [linter_error .description for linter_error in linter_errors ]
280
280
281
- def _get_path_to_function_decl (
282
- self , function : Callable [..., Any ] # pyre-ignore[2]
283
- ) -> str :
284
- """
285
- Attempts to return the path to the file where the function is implemented.
286
- This can be different from the path where the function is looked up, for example if we have:
287
- my_component defined in some_file.py, imported in other_file.py
288
- and the component is invoked as other_file.py:my_component
289
- """
290
- # Unwrap decorated functions to get the original function
291
- unwrapped_function = inspect .unwrap (function )
292
- path_to_function_decl = inspect .getabsfile (unwrapped_function )
293
- if path_to_function_decl is None or not os .path .isfile (path_to_function_decl ):
294
- return self ._filepath
295
- return path_to_function_decl
296
-
297
281
def find (
298
282
self , validators : Optional [List [ComponentFunctionValidator ]]
299
283
) -> List [_Component ]:
284
+ validation_errors = self ._get_validation_errors (
285
+ self ._filepath , self ._function_name , validators
286
+ )
300
287
301
288
file_source = read_conf_file (self ._filepath )
302
289
namespace = copy .copy (globals ())
@@ -309,12 +296,6 @@ def find(
309
296
)
310
297
app_fn = namespace [self ._function_name ]
311
298
fn_desc , _ = get_fn_docstring (app_fn )
312
-
313
- func_path = self ._get_path_to_function_decl (app_fn )
314
- validation_errors = self ._get_validation_errors (
315
- func_path , self ._function_name , validators
316
- )
317
-
318
299
return [
319
300
_Component (
320
301
name = f"{ self ._filepath } :{ self ._function_name } " ,
0 commit comments