Using partial instead of defining a new func
This commit is contained in:
parent
8bae0d4cfc
commit
f0e5b243c6
@ -20,6 +20,7 @@
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import functools
|
||||
import json
|
||||
import sys
|
||||
import os
|
||||
@ -197,9 +198,9 @@ def audit_for_period(beginning, ending, ums=False, ums_offset=0):
|
||||
ending_decimal = dt.dt_to_decimal(ending)
|
||||
|
||||
if ums:
|
||||
def verifier_audit_func(start, end, model):
|
||||
return usage_audit._verifier_audit_for_day_ums(start, end, model,
|
||||
ums_offset)
|
||||
verifier_audit_func = functools.partial(
|
||||
usage_audit._verifier_audit_for_day_ums, ums_offset=ums_offset
|
||||
)
|
||||
else:
|
||||
verifier_audit_func = usage_audit._verifier_audit_for_day
|
||||
|
||||
|
@ -94,7 +94,7 @@ def _verifier_audit_for_day(beginning, ending, exists_model):
|
||||
return _verified_audit_base(base_query, exists_model)
|
||||
|
||||
|
||||
def _verifier_audit_for_day_ums(beginning, ending, exists_model, ums_offset):
|
||||
def _verifier_audit_for_day_ums(beginning, ending, exists_model, ums_offset=0):
|
||||
# NOTE(apmelton):
|
||||
# This is the UMS query we're trying to match.
|
||||
# where (
|
||||
|
Loading…
x
Reference in New Issue
Block a user