diff --git a/data-pipeline/bcreg/bcreg_core.py b/data-pipeline/bcreg/bcreg_core.py index 1ccc982..153967a 100644 --- a/data-pipeline/bcreg/bcreg_core.py +++ b/data-pipeline/bcreg/bcreg_core.py @@ -683,7 +683,7 @@ def cache_lear_bcreg_corp_tables(self, specific_corps, generate_individual_sql=F txn_ids_list = [] corp_nums_list_str = self.id_where_in(corp_nums_list, True) corp_num_where = 'identifier in (' + corp_nums_list_str + ')' if 0 < len(corp_nums_list_str) else "identifier = ''" - corp_num_where_ex = corp_num_where + f" UNION {UNION_SELECT_PLACEHOLDER} WHERE id in (select business_id from party_roles, parties where party_roles.party_id = parties.id and parties." + corp_num_where + ")" + corp_num_where_ex = corp_num_where + f" UNION {UNION_SELECT_PLACEHOLDER} WHERE id in (select distinct business_id from party_roles_version, parties_version where party_roles_version.party_id = parties_version.id and parties_version." + corp_num_where + ")" for corp_table in self.lear_corp_tables: _rows = self.get_bcreg_table(corp_table, corp_num_where_ex, '', True, generate_individual_sql, use_sec=use_sec) if corp_table == 'businesses': @@ -696,7 +696,7 @@ def cache_lear_bcreg_corp_tables(self, specific_corps, generate_individual_sql=F party_ids_list = [] bus_id_where = 'business_id in (' + self.id_where_in(bus_ids_list, True) + ')' if 0 < len(bus_ids_list) else "business_id = 0" - bus_id_where += f" UNION {UNION_SELECT_PLACEHOLDER} WHERE business_id in (select business_id from party_roles, parties where party_roles.party_id = parties.id and parties." + corp_num_where + ")" + bus_id_where += f" UNION {UNION_SELECT_PLACEHOLDER} WHERE business_id in (select distinct business_id from party_roles_version, parties_version where party_roles_version.party_id = parties_version.id and parties_version." + corp_num_where + ")" for other_table in self.lear_other_tables: _rows = self.get_bcreg_table(other_table, bus_id_where, '', True, generate_individual_sql, use_sec=use_sec) if other_table == 'party_roles': diff --git a/data-pipeline/bcreg/find-test-corps-lear.py b/data-pipeline/bcreg/find-test-corps-lear.py index ce93ee2..e10ab59 100644 --- a/data-pipeline/bcreg/find-test-corps-lear.py +++ b/data-pipeline/bcreg/find-test-corps-lear.py @@ -1183,6 +1183,7 @@ "FM0733881", "FM0733880", "FM0650512", +"FM1003299", ] diff --git a/data-pipeline/bcreg/find-test-corps.py b/data-pipeline/bcreg/find-test-corps.py index 1b22751..b74fdfc 100644 --- a/data-pipeline/bcreg/find-test-corps.py +++ b/data-pipeline/bcreg/find-test-corps.py @@ -401,8 +401,9 @@ 'FM1048326', 'A0132048', 'A0133092', - 'BC1489198', - 'BC1026494', + '1489198', + '1026494', + '0593892', ] @@ -438,8 +439,8 @@ # get specific test corps (there are about 6) print("Get specific corps") corps = bc_registries.get_specific_corps(specific_corps) - #corps_2 = bc_registries.get_specific_corps(specific_corps_2) - #corps.extend(corps_2) + corps_2 = bc_registries.get_specific_corps(specific_corps_2) + corps.extend(corps_2) print("Find unprocessed events for each corp") last_event_dt = bc_registries.get_event_effective_date(prev_event_id)