Skip to content

Commit

Permalink
24721 Update extract script not to map Q* to BC (bcgov#3177)
Browse files Browse the repository at this point in the history
* update Q* type mapping

Signed-off-by: Hongjing Chen <[email protected]>

* set default index for get unprocessed corps query

Signed-off-by: Hongjing Chen <[email protected]>

* complete & remove one TO-DO in the code

Signed-off-by: Hongjing Chen <[email protected]>

* undo

Signed-off-by: Hongjing Chen <[email protected]>

---------

Signed-off-by: Hongjing Chen <[email protected]>
  • Loading branch information
chenhongjing authored Jan 21, 2025
1 parent c69b560 commit f8d63cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions data-tool/flows/tombstone/tombstone_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def get_unprocessed_corps_subquery(flow_name, environment):
# [2]->[1]->[3] (may fetch fewer eligible corps in [2] at the beginning, if so, go to [1] and then go back to [2], repeatedly)
# Other usage:
# [0] is used for other purposes, e.g. tweak query to select specific corps
subquery = subqueries[2]
subquery = subqueries[3]
return subquery['cte'], subquery['where']

def get_unprocessed_corps_query(flow_name, environment, batch_size):
Expand Down Expand Up @@ -131,7 +131,7 @@ def get_unprocessed_corps_query(flow_name, environment, batch_size):
-- 'BC0805986', 'BC0561086', -- amalg - v
-- 'BC0543231', 'BC0358476' -- amalg - h
-- )
and c.corp_type_cd in ('BC', 'C', 'ULC', 'CUL', 'CC', 'CCC', 'QA', 'QB', 'QC', 'QD', 'QE') -- TODO: update transfer script
and c.corp_type_cd in ('BC', 'C', 'ULC', 'CUL', 'CC', 'CCC', 'QA', 'QB', 'QC', 'QD', 'QE')
and cs.end_event_id is null
-- and ((cp.processed_status is null or cp.processed_status != 'COMPLETED'))
and cp.processed_status is null
Expand Down
5 changes: 1 addition & 4 deletions data-tool/scripts/transfer_cprd_corps.sql
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ select case
else c.CORP_NUM
end CORP_NUM,
CORP_FROZEN_TYP_CD as corp_frozen_type_cd,
case
when c.CORP_TYP_CD in ('QA', 'QB', 'QC', 'QD', 'QE') then 'BC'
else c.CORP_TYP_CD
end CORP_TYPE_CD,
CORP_TYP_CD as CORP_TYPE_CD,
RECOGNITION_DTS,
BN_9,
bn_15,
Expand Down

0 comments on commit f8d63cc

Please sign in to comment.