Skip to content

Commit a204488

Browse files
committed
Works with the issue GoogleCloudPlatform#6
1 parent 19fafd7 commit a204488

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

functions/gcs/gcs_location_matching_trigger.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,14 @@ def _run_location_matching(table, destination_table, bq_client, algorithm):
251251
returns float64
252252
language js as \"\"\"
253253
var rawScore = 50*(1-chain_match) + 50*(1-addr_match);
254-
var score =
255-
(chain_match == 0 || addr_match == 0) ? 100 :
256-
chain_match > 1 && addr_match >= .5 ? Math.min(5, rawScore) :
257-
chain_match >= .8 && addr_match >= .5 ? Math.min(15, rawScore) :
258-
addr_match >= .8 && chain_match >= .5 ? Math.min(15, rawScore) :
259-
chain_match >= .3 && addr_match >= .9 ? Math.min(20, rawScore) :
260-
rawScore;
254+
var score =
255+
(chain_match == 0) ? 100 :
256+
chain_match > 1 && addr_match >= .5 ? Math.min(5, rawScore) :
257+
chain_match >= .8 && addr_match >= .5 ? Math.min(15, rawScore) :
258+
addr_match >= .8 && chain_match >= .5 ? Math.min(15, rawScore) :
259+
chain_match >= .3 && addr_match >= .9 ? Math.min(20, rawScore) :
260+
chain_match > 1 ? Math.min(20, rawScore) :
261+
rawScore;
261262
return score;
262263
\"\"\"
263264
OPTIONS (
@@ -770,6 +771,7 @@ def process_location_matching(data, context):
770771

771772

772773
# process_location_matching({'name': '[email protected]/simple_list___no_mv_gcs.txt'}, None)
773-
process_location_matching({'name': '[email protected]/Matching_list_nozip___no_mv_gcs.txt'}, None)
774+
# process_location_matching({'name': '[email protected]/Matching_list_nozip___no_mv_gcs.txt'}, None)
775+
process_location_matching({'name': '[email protected]/walmart_list_with_match_issue_6___no_mv_gcs.txt'}, None)
774776
# process_location_matching({'name': '[email protected]/walmart_list_with_match_issue___no_mv_gcs.txt'}, None)
775777
# _send_mail('[email protected]', ['[email protected]'], 'My test', 'The body')

0 commit comments

Comments
 (0)