Skip to content

Commit

Permalink
Dev 1.10.0 webank merge udf register function (#686)
Browse files Browse the repository at this point in the history
* feat: Parse UDF function name interface submission

* feat: Parse UDF function name interface submission
  • Loading branch information
taoran1250 authored Dec 18, 2024
1 parent 30a72f7 commit aea92fd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions linkis-dist/package/admin/linkis_udf_get_python_methods.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import sys
import ast
import json

def extract_method_names(file_path):
with open(file_path, 'r') as file:
code = file.read()
tree = ast.parse(code)
method_names = set()

for node in ast.walk(tree):
if isinstance(node, ast.FunctionDef):
method_names.add(node.name)

return json.dumps(list(method_names), indent=4)

file_path = sys.argv[1]
print(extract_method_names(file_path))

0 comments on commit aea92fd

Please sign in to comment.