assign 'match' var in compute units udf (#292)

This commit is contained in:
tarikceric 2023-05-04 18:27:08 -05:00 committed by GitHub
parent b6b888f5b9
commit dc27879dd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,6 +159,7 @@ as
$$
def get_compute_units_total(log_messages, instructions):
import re
match = None
for instr in instructions:
program_id = instr['programId']
for logs in log_messages:
@ -166,7 +167,8 @@ def get_compute_units_total(log_messages, instructions):
if match:
total_units = int(match.group(1))
return total_units
return None if match is None else total_units
if match is None:
return None
$$;
{% endmacro %}