Skip to content

Commit 764a4b5

Browse files
committed
bug_fix(1477): type handling in _add_sql_comment
1 parent 59ecd4d commit 764a4b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

opentelemetry-instrumentation/src/opentelemetry/instrumentation/sqlcommenter_utils.py

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def _add_sql_comment(sql, **meta) -> str:
2222
"""
2323
meta.update(**_add_framework_tags())
2424
comment = _generate_sql_comment(**meta)
25+
# converting to str to handle any type errors
26+
sql = str(sql)
2527
sql = sql.rstrip()
2628
if sql[-1] == ";":
2729
sql = sql[:-1] + comment + ";"

0 commit comments

Comments
 (0)