Skip to content

Commit 3036f86

Browse files
committed
Fixed the issue
1 parent 0e3b7c8 commit 3036f86

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

bifrost_tracing/bifrost_tracing.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def visit_Subscript(self, node: ast.Subscript):
150150
self.visit_Subscript(left)
151151
else:
152152
self.subscripts.append([left.value.id, left.attr])
153-
else:
153+
elif isinstance(node.value, ast.Name) and isinstance(node.slice, ast.Constant):
154154
self.subscripts.append([node.value.id, node.slice.value])
155155

156156

@@ -226,9 +226,11 @@ def get_args(self, value, dataframe=None):
226226
if isinstance(value, ast.Subscript):
227227
subscriptVisitor = SubscriptVisitor()
228228
subscriptVisitor.visit(value)
229-
self.args.append(
230-
f"{subscriptVisitor.subscripts[0][0]}.{subscriptVisitor.subscripts[0][1]}"
231-
)
229+
if len(subscriptVisitor.subscripts) != 0:
230+
self.args.append(
231+
f"{subscriptVisitor.subscripts[0][0]}.{subscriptVisitor.subscripts[0][1]}"
232+
)
233+
232234
# case arg is df.one
233235
elif isinstance(value, ast.Attribute):
234236
attributeVisitor = AttributeVisitor()

0 commit comments

Comments
 (0)