Skip to content

Commit 9b239b9

Browse files
authored
Select only functions for node id function validation (#6238)
1 parent 3dc9c15 commit 9b239b9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

utils/manifest/_internal/validate.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import ast
22
import importlib.util
3+
import inspect
34
import json
45
import sys
56
from pathlib import Path
@@ -176,7 +177,8 @@ def assert_nodeids_exist(obj: dict) -> list[str]:
176177

177178
if function_name is not None:
178179
class_obj = getattr(module, class_name)
179-
found_function = hasattr(class_obj, function_name)
180+
attr = getattr(class_obj, function_name, None)
181+
found_function = attr is not None and inspect.isfunction(attr)
180182

181183
if not found_function:
182184
errors.append(f"{file_path}::{class_name} does not contain function {function_name}")

0 commit comments

Comments
 (0)