|
20 | 20 | covid_faba_spending_load_sql_strings, |
21 | 21 | ) |
22 | 22 | from usaspending_api.disaster.models import CovidFABASpending |
| 23 | +from usaspending_api.download.delta_models.account_balances_download import ( |
| 24 | + account_balances_schema, |
| 25 | + load_account_balances, |
| 26 | + load_account_balances_incremental, |
| 27 | +) |
23 | 28 | from usaspending_api.download.delta_models.award_financial_download import ( |
| 29 | + award_financial_schema, |
24 | 30 | load_award_financial, |
25 | 31 | load_award_financial_incremental, |
26 | | - award_financial_schema, |
27 | 32 | ) |
28 | 33 | from usaspending_api.download.delta_models.object_class_program_activity_download import ( |
29 | | - object_class_program_activity_schema, |
30 | 34 | load_object_class_program_activity, |
31 | 35 | load_object_class_program_activity_incremental, |
32 | | -) |
33 | | -from usaspending_api.download.delta_models.account_balances_download import ( |
34 | | - load_account_balances, |
35 | | - load_account_balances_incremental, |
36 | | - account_balances_schema, |
| 36 | + object_class_program_activity_schema, |
37 | 37 | ) |
38 | 38 | from usaspending_api.download.delta_models.transaction_download import transaction_download_schema |
39 | 39 | from usaspending_api.recipient.delta_models import ( |
|
84 | 84 | transaction_search_create_sql_string, |
85 | 85 | ) |
86 | 86 |
|
87 | | - |
88 | 87 | AWARD_URL = f"{HOST}/award/" if "localhost" in HOST else f"https://{HOST}/award/" |
89 | 88 |
|
90 | 89 | logger = logging.getLogger(__name__) |
|
105 | 104 | "is_partition_column_unique": True, |
106 | 105 | "delta_table_create_sql": award_search_create_sql_string, |
107 | 106 | "delta_table_create_options": None, |
108 | | - "delta_table_create_partitions": None, |
109 | 107 | "source_schema": AWARD_SEARCH_POSTGRES_COLUMNS, |
110 | 108 | "custom_schema": "recipient_hash STRING, federal_accounts STRING, cfdas ARRAY<STRING>," |
111 | 109 | " tas_components ARRAY<STRING>", |
112 | 110 | "column_names": list(AWARD_SEARCH_COLUMNS), |
113 | 111 | "postgres_seq_name": None, |
114 | 112 | "tsvectors": None, |
115 | 113 | "postgres_partition_spec": None, |
| 114 | + "delta_table_create_partitions": None, |
116 | 115 | }, |
117 | 116 | "award_search_gold": { |
118 | 117 | "model": AwardSearch, |
|
129 | 128 | "is_partition_column_unique": True, |
130 | 129 | "delta_table_create_sql": award_search_create_sql_string, |
131 | 130 | "delta_table_create_options": None, |
132 | | - "delta_table_create_partitions": None, |
133 | 131 | "source_schema": AWARD_SEARCH_POSTGRES_GOLD_COLUMNS, |
134 | 132 | "custom_schema": "recipient_hash STRING, federal_accounts STRING, cfdas ARRAY<STRING>," |
135 | 133 | " tas_components ARRAY<STRING>", |
136 | 134 | "column_names": list(AWARD_SEARCH_POSTGRES_GOLD_COLUMNS), |
137 | 135 | "postgres_seq_name": None, |
138 | 136 | "tsvectors": None, |
139 | 137 | "postgres_partition_spec": None, |
| 138 | + "delta_table_create_partitions": None, |
140 | 139 | }, |
141 | 140 | "recipient_lookup": { |
142 | 141 | "model": RecipientLookup, |
|
153 | 152 | "is_partition_column_unique": True, |
154 | 153 | "delta_table_create_sql": rpt_recipient_lookup_create_sql_string, |
155 | 154 | "delta_table_create_options": None, |
156 | | - "delta_table_create_partitions": None, |
157 | 155 | "source_schema": RECIPIENT_LOOKUP_POSTGRES_COLUMNS, |
158 | 156 | "custom_schema": "recipient_hash STRING", |
159 | 157 | "column_names": list(RPT_RECIPIENT_LOOKUP_DELTA_COLUMNS), |
160 | 158 | "postgres_seq_name": "recipient_lookup_id_seq", |
161 | 159 | "tsvectors": None, |
162 | 160 | "postgres_partition_spec": None, |
| 161 | + "delta_table_create_partitions": None, |
163 | 162 | }, |
164 | 163 | "recipient_profile": { |
165 | 164 | "model": RecipientProfile, |
|
176 | 175 | "is_partition_column_unique": False, |
177 | 176 | "delta_table_create_sql": recipient_profile_create_sql_string, |
178 | 177 | "delta_table_create_options": None, |
179 | | - "delta_table_create_partitions": None, |
180 | 178 | "source_schema": RECIPIENT_PROFILE_POSTGRES_COLUMNS, |
181 | 179 | "custom_schema": "recipient_hash STRING", |
182 | 180 | "column_names": list(RPT_RECIPIENT_PROFILE_DELTA_COLUMNS), |
183 | 181 | "postgres_seq_name": "recipient_profile_id_seq", |
184 | 182 | "tsvectors": None, |
185 | 183 | "postgres_partition_spec": None, |
| 184 | + "delta_table_create_partitions": None, |
186 | 185 | }, |
187 | 186 | "summary_state_view": { |
188 | 187 | "model": SummaryStateView, |
|
199 | 198 | "is_partition_column_unique": True, |
200 | 199 | "delta_table_create_sql": summary_state_view_create_sql_string, |
201 | 200 | "delta_table_create_options": None, |
202 | | - "delta_table_create_partitions": None, |
203 | 201 | "source_schema": SUMMARY_STATE_VIEW_POSTGRES_COLUMNS, |
204 | 202 | "custom_schema": "duh STRING", |
205 | 203 | "column_names": list(SUMMARY_STATE_VIEW_COLUMNS), |
206 | 204 | "postgres_seq_name": None, |
207 | 205 | "tsvectors": None, |
208 | 206 | "postgres_partition_spec": None, |
| 207 | + "delta_table_create_partitions": None, |
209 | 208 | }, |
210 | 209 | "sam_recipient": { |
211 | 210 | "model": None, |
|
222 | 221 | "is_partition_column_unique": True, |
223 | 222 | "delta_table_create_sql": sam_recipient_create_sql_string, |
224 | 223 | "delta_table_create_options": None, |
225 | | - "delta_table_create_partitions": None, |
226 | 224 | "source_schema": SAM_RECIPIENT_POSTGRES_COLUMNS, |
227 | 225 | "custom_schema": None, |
228 | 226 | "column_names": list(SAM_RECIPIENT_COLUMNS), |
229 | 227 | "postgres_seq_name": None, |
230 | 228 | "tsvectors": None, |
231 | 229 | "postgres_partition_spec": None, |
| 230 | + "delta_table_create_partitions": None, |
232 | 231 | }, |
233 | 232 | "transaction_search": { |
234 | 233 | "model": TransactionSearch, |
|
245 | 244 | "is_partition_column_unique": True, |
246 | 245 | "delta_table_create_sql": transaction_search_create_sql_string, |
247 | 246 | "delta_table_create_options": None, |
248 | | - "delta_table_create_partitions": None, |
249 | 247 | "source_schema": TRANSACTION_SEARCH_POSTGRES_COLUMNS, |
250 | 248 | "custom_schema": "recipient_hash STRING, federal_accounts STRING, parent_recipient_hash STRING", |
251 | 249 | "column_names": list(TRANSACTION_SEARCH_POSTGRES_COLUMNS), |
252 | 250 | "postgres_seq_name": None, |
253 | 251 | "tsvectors": None, |
254 | 252 | "postgres_partition_spec": None, |
| 253 | + "delta_table_create_partitions": None, |
255 | 254 | }, |
256 | 255 | "transaction_search_gold": { |
257 | 256 | "model": TransactionSearch, |
|
268 | 267 | "is_partition_column_unique": True, |
269 | 268 | "delta_table_create_sql": transaction_search_create_sql_string, |
270 | 269 | "delta_table_create_options": None, |
271 | | - "delta_table_create_partitions": None, |
272 | 270 | "source_schema": TRANSACTION_SEARCH_POSTGRES_GOLD_COLUMNS, |
273 | 271 | "custom_schema": "recipient_hash STRING, federal_accounts STRING, parent_recipient_hash STRING", |
274 | 272 | "column_names": list(TRANSACTION_SEARCH_POSTGRES_GOLD_COLUMNS), |
|
282 | 280 | {"table_suffix": "_fabs", "partitioning_clause": "FOR VALUES IN (FALSE)"}, |
283 | 281 | ], |
284 | 282 | }, |
| 283 | + "delta_table_create_partitions": None, |
285 | 284 | }, |
286 | 285 | "transaction_current_cd_lookup": { |
287 | 286 | "model": None, |
|
298 | 297 | "is_partition_column_unique": True, |
299 | 298 | "delta_table_create_sql": transaction_current_cd_lookup_create_sql_string, |
300 | 299 | "delta_table_create_options": None, |
301 | | - "delta_table_create_partitions": None, |
302 | 300 | "source_schema": TRANSACTION_CURRENT_CD_LOOKUP_COLUMNS, |
303 | 301 | "custom_schema": "", |
304 | 302 | "column_names": list(TRANSACTION_CURRENT_CD_LOOKUP_COLUMNS), |
305 | 303 | "postgres_seq_name": None, |
306 | 304 | "tsvectors": None, |
307 | 305 | "postgres_partition_spec": None, |
| 306 | + "delta_table_create_partitions": None, |
308 | 307 | }, |
309 | 308 | "subaward_search": { |
310 | 309 | "model": SubawardSearch, |
|
321 | 320 | "is_partition_column_unique": True, |
322 | 321 | "delta_table_create_sql": subaward_search_create_sql_string, |
323 | 322 | "delta_table_create_options": None, |
324 | | - "delta_table_create_partitions": None, |
325 | 323 | "source_schema": SUBAWARD_SEARCH_POSTGRES_COLUMNS, |
326 | 324 | "custom_schema": "treasury_account_identifiers ARRAY<INTEGER>", |
327 | 325 | "column_names": list(SUBAWARD_SEARCH_COLUMNS), |
328 | 326 | "postgres_seq_name": None, |
329 | 327 | "tsvectors": SUBAWARD_SEARCH_POSTGRES_VECTORS, |
330 | 328 | "postgres_partition_spec": None, |
| 329 | + "delta_table_create_partitions": None, |
331 | 330 | }, |
332 | 331 | "covid_faba_spending": { |
333 | 332 | "model": CovidFABASpending, |
|
344 | 343 | "is_partition_column_unique": False, |
345 | 344 | "delta_table_create_sql": covid_faba_spending_create_sql_string, |
346 | 345 | "delta_table_create_options": None, |
347 | | - "delta_table_create_partitions": None, |
348 | 346 | "source_schema": COVID_FABA_SPENDING_POSTGRES_COLUMNS, |
349 | 347 | "custom_schema": None, |
350 | 348 | "column_names": list(COVID_FABA_SPENDING_DELTA_COLUMNS), |
351 | 349 | "postgres_seq_name": None, |
352 | 350 | "tsvectors": None, |
353 | 351 | "postgres_partition_spec": None, |
| 352 | + "delta_table_create_partitions": None, |
354 | 353 | }, |
355 | 354 | "account_balances_download": { |
356 | 355 | "model": None, |
|
367 | 366 | "is_partition_column_unique": False, |
368 | 367 | "delta_table_create_sql": account_balances_schema, |
369 | 368 | "delta_table_create_options": {"delta.enableChangeDataFeed": True}, |
370 | | - "delta_table_create_partitions": None, |
371 | 369 | "source_schema": None, |
372 | 370 | "custom_schema": None, |
373 | 371 | "column_names": list(), |
374 | 372 | "postgres_seq_name": None, |
375 | 373 | "tsvectors": None, |
376 | 374 | "postgres_partition_spec": None, |
| 375 | + "delta_table_create_partitions": ["reporting_fiscal_year", "funding_toptier_agency_id"], |
377 | 376 | }, |
378 | 377 | "award_financial_download": { |
379 | 378 | "model": None, |
|
390 | 389 | "is_partition_column_unique": False, |
391 | 390 | "delta_table_create_sql": award_financial_schema, |
392 | 391 | "delta_table_create_options": {"delta.enableChangeDataFeed": True}, |
393 | | - "delta_table_create_partitions": None, |
394 | 392 | "source_schema": None, |
395 | 393 | "custom_schema": None, |
396 | 394 | "column_names": list(), |
397 | 395 | "postgres_seq_name": None, |
398 | 396 | "tsvectors": None, |
399 | 397 | "postgres_partition_spec": None, |
| 398 | + "delta_table_create_partitions": ["reporting_fiscal_year", "funding_toptier_agency_id"], |
400 | 399 | }, |
401 | 400 | "object_class_program_activity_download": { |
402 | 401 | "model": None, |
|
413 | 412 | "is_partition_column_unique": False, |
414 | 413 | "delta_table_create_sql": object_class_program_activity_schema, |
415 | 414 | "delta_table_create_options": {"delta.enableChangeDataFeed": True}, |
416 | | - "delta_table_create_partitions": None, |
417 | 415 | "source_schema": None, |
418 | 416 | "custom_schema": None, |
419 | 417 | "column_names": list(), |
420 | 418 | "postgres_seq_name": None, |
421 | 419 | "tsvectors": None, |
422 | 420 | "postgres_partition_spec": None, |
| 421 | + "delta_table_create_partitions": ["reporting_fiscal_year", "funding_toptier_agency_id"], |
423 | 422 | }, |
424 | 423 | "transaction_download": { |
425 | 424 | "model": None, |
|
436 | 435 | "is_partition_column_unique": False, |
437 | 436 | "delta_table_create_sql": transaction_download_schema, |
438 | 437 | "delta_table_create_options": {"delta.enableChangeDataFeed": True}, |
439 | | - "delta_table_create_partitions": ["awarding_agency_code", "is_fpds", "action_date_fiscal_year"], |
440 | 438 | "source_schema": None, |
441 | 439 | "custom_schema": None, |
442 | 440 | "column_names": list(), |
443 | 441 | "postgres_seq_name": None, |
444 | 442 | "tsvectors": None, |
445 | 443 | "postgres_partition_spec": None, |
| 444 | + "delta_table_create_partitions": ["awarding_agency_code", "is_fpds", "action_date_fiscal_year"], |
446 | 445 | }, |
447 | 446 | } |
448 | 447 |
|
|
0 commit comments