Skip to content

Commit 7626e3b

Browse files
Fix sql_format error on database_trace (#610)
* Add check for sql_format in database_trace.py * Fix typo. * [Mega-Linter] Apply linters fixes Co-authored-by: umaannamalai <[email protected]> Co-authored-by: Timothy Pansino <[email protected]>
1 parent 996178c commit 7626e3b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

newrelic/api/database_trace.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,9 @@ def finalize_data(self, transaction, exc=None, value=None, tb=None):
205205
execute_params = self.execute_params
206206
transaction._explain_plan_count += 1
207207

208-
self.sql_format = tt.record_sql
209-
208+
self.sql_format = (
209+
tt.record_sql if tt.record_sql else ""
210+
) # If tt.record_sql is None, then the empty string will default to sql being obfuscated
210211
self.connect_params = connect_params
211212
self.cursor_params = cursor_params
212213
self.sql_parameters = sql_parameters

0 commit comments

Comments
 (0)