@@ -235,19 +235,47 @@ def open(
235
235
task : Task ,
236
236
all_bindings ,
237
237
):
238
- fetch_changes_fns = {
239
- account_id : functools .partial (
240
- fetch_incremental , cls , platform_account_id , account_id , http
238
+ if not connected_account_ids or len (connected_account_ids ) == 0 :
239
+ fetch_changes_fns = functools .partial (
240
+ fetch_incremental ,
241
+ cls ,
242
+ platform_account_id ,
243
+ None ,
244
+ http ,
241
245
)
242
- for account_id in all_account_ids
243
- }
246
+ else :
247
+ fetch_changes_fns = {
248
+ account_id : functools .partial (
249
+ fetch_incremental ,
250
+ cls ,
251
+ platform_account_id ,
252
+ account_id ,
253
+ http ,
254
+ )
255
+ for account_id in all_account_ids
256
+ }
244
257
245
- fetch_page_fns = {
246
- account_id : functools .partial (
247
- fetch_backfill , cls , start_date , platform_account_id , account_id , http
258
+ if not connected_account_ids or len (connected_account_ids ) == 0 :
259
+ fetch_page_fns = functools .partial (
260
+ fetch_backfill ,
261
+ cls ,
262
+ start_date ,
263
+ platform_account_id ,
264
+ None ,
265
+ http ,
248
266
)
249
- for account_id in all_account_ids
250
- }
267
+ else :
268
+ fetch_page_fns = {
269
+ account_id : functools .partial (
270
+ fetch_backfill ,
271
+ cls ,
272
+ start_date ,
273
+ platform_account_id ,
274
+ account_id ,
275
+ http ,
276
+ )
277
+ for account_id in all_account_ids
278
+ }
251
279
252
280
open_binding (
253
281
binding ,
@@ -293,30 +321,51 @@ def open(
293
321
task : Task ,
294
322
all_bindings ,
295
323
):
296
- fetch_changes_fns = {
297
- account_id : functools .partial (
324
+ if not connected_account_ids or len ( connected_account_ids ) == 0 :
325
+ fetch_changes_fns = functools .partial (
298
326
fetch_incremental_substreams ,
299
327
cls ,
300
328
child_cls ,
301
329
platform_account_id ,
302
- account_id ,
330
+ None ,
303
331
http ,
304
332
)
305
- for account_id in all_account_ids
306
- }
333
+ else :
334
+ fetch_changes_fns = {
335
+ account_id : functools .partial (
336
+ fetch_incremental_substreams ,
337
+ cls ,
338
+ child_cls ,
339
+ platform_account_id ,
340
+ account_id ,
341
+ http ,
342
+ )
343
+ for account_id in all_account_ids
344
+ }
307
345
308
- fetch_page_fns = {
309
- account_id : functools .partial (
346
+ if not connected_account_ids or len ( connected_account_ids ) == 0 :
347
+ fetch_page_fns = functools .partial (
310
348
fetch_backfill_substreams ,
311
349
cls ,
312
350
child_cls ,
313
351
start_date ,
314
352
platform_account_id ,
315
- account_id ,
353
+ None ,
316
354
http ,
317
355
)
318
- for account_id in all_account_ids
319
- }
356
+ else :
357
+ fetch_page_fns = {
358
+ account_id : functools .partial (
359
+ fetch_backfill_substreams ,
360
+ cls ,
361
+ child_cls ,
362
+ start_date ,
363
+ platform_account_id ,
364
+ account_id ,
365
+ http ,
366
+ )
367
+ for account_id in all_account_ids
368
+ }
320
369
321
370
open_binding (
322
371
binding ,
@@ -365,25 +414,49 @@ def open(
365
414
task : Task ,
366
415
all_bindings ,
367
416
):
368
- fetch_changes_fns = {
369
- account_id : functools .partial (
370
- fetch_incremental , child_cls , platform_account_id , account_id , http
417
+ if not connected_account_ids or len (connected_account_ids ) == 0 :
418
+ fetch_changes_fns = functools .partial (
419
+ fetch_incremental ,
420
+ child_cls ,
421
+ platform_account_id ,
422
+ None ,
423
+ http ,
371
424
)
372
- for account_id in all_account_ids
373
- }
425
+ else :
426
+ fetch_changes_fns = {
427
+ account_id : functools .partial (
428
+ fetch_incremental ,
429
+ child_cls ,
430
+ platform_account_id ,
431
+ account_id ,
432
+ http ,
433
+ )
434
+ for account_id in all_account_ids
435
+ }
374
436
375
- fetch_page_fns = {
376
- account_id : functools .partial (
437
+ if not connected_account_ids or len ( connected_account_ids ) == 0 :
438
+ fetch_page_fns = functools .partial (
377
439
fetch_backfill_substreams ,
378
440
cls ,
379
441
child_cls ,
380
442
start_date ,
381
443
platform_account_id ,
382
- account_id ,
444
+ None ,
383
445
http ,
384
446
)
385
- for account_id in all_account_ids
386
- }
447
+ else :
448
+ fetch_page_fns = {
449
+ account_id : functools .partial (
450
+ fetch_backfill_substreams ,
451
+ cls ,
452
+ child_cls ,
453
+ start_date ,
454
+ platform_account_id ,
455
+ account_id ,
456
+ http ,
457
+ )
458
+ for account_id in all_account_ids
459
+ }
387
460
388
461
open_binding (
389
462
binding ,
@@ -431,30 +504,51 @@ def open(
431
504
task : Task ,
432
505
all_bindings ,
433
506
):
434
- fetch_changes_fns = {
435
- account_id : functools .partial (
507
+ if not connected_account_ids or len ( connected_account_ids ) == 0 :
508
+ fetch_changes_fns = functools .partial (
436
509
fetch_incremental_usage_records ,
437
510
cls ,
438
511
child_cls ,
439
512
platform_account_id ,
440
- account_id ,
513
+ None ,
441
514
http ,
442
515
)
443
- for account_id in all_account_ids
444
- }
516
+ else :
517
+ fetch_changes_fns = {
518
+ account_id : functools .partial (
519
+ fetch_incremental_usage_records ,
520
+ cls ,
521
+ child_cls ,
522
+ platform_account_id ,
523
+ account_id ,
524
+ http ,
525
+ )
526
+ for account_id in all_account_ids
527
+ }
445
528
446
- fetch_page_fns = {
447
- account_id : functools .partial (
529
+ if not connected_account_ids or len ( connected_account_ids ) == 0 :
530
+ fetch_page_fns = functools .partial (
448
531
fetch_backfill_usage_records ,
449
532
cls ,
450
533
child_cls ,
451
534
start_date ,
452
535
platform_account_id ,
453
- account_id ,
536
+ None ,
454
537
http ,
455
538
)
456
- for account_id in all_account_ids
457
- }
539
+ else :
540
+ fetch_page_fns = {
541
+ account_id : functools .partial (
542
+ fetch_backfill_usage_records ,
543
+ cls ,
544
+ child_cls ,
545
+ start_date ,
546
+ platform_account_id ,
547
+ account_id ,
548
+ http ,
549
+ )
550
+ for account_id in all_account_ids
551
+ }
458
552
459
553
open_binding (
460
554
binding ,
@@ -502,19 +596,47 @@ def open(
502
596
task : Task ,
503
597
all_bindings ,
504
598
):
505
- fetch_changes_fns = {
506
- account_id : functools .partial (
507
- fetch_incremental_no_events , cls , platform_account_id , account_id , http
599
+ if not connected_account_ids or len (connected_account_ids ) == 0 :
600
+ fetch_changes_fns = functools .partial (
601
+ fetch_incremental_no_events ,
602
+ cls ,
603
+ platform_account_id ,
604
+ None ,
605
+ http ,
508
606
)
509
- for account_id in all_account_ids
510
- }
607
+ else :
608
+ fetch_changes_fns = {
609
+ account_id : functools .partial (
610
+ fetch_incremental_no_events ,
611
+ cls ,
612
+ platform_account_id ,
613
+ account_id ,
614
+ http ,
615
+ )
616
+ for account_id in all_account_ids
617
+ }
511
618
512
- fetch_page_fns = {
513
- account_id : functools .partial (
514
- fetch_backfill , cls , start_date , platform_account_id , account_id , http
619
+ if not connected_account_ids or len (connected_account_ids ) == 0 :
620
+ fetch_page_fns = functools .partial (
621
+ fetch_backfill ,
622
+ cls ,
623
+ start_date ,
624
+ platform_account_id ,
625
+ None ,
626
+ http ,
515
627
)
516
- for account_id in all_account_ids
517
- }
628
+ else :
629
+ fetch_page_fns = {
630
+ account_id : functools .partial (
631
+ fetch_backfill ,
632
+ cls ,
633
+ start_date ,
634
+ platform_account_id ,
635
+ account_id ,
636
+ http ,
637
+ )
638
+ for account_id in all_account_ids
639
+ }
518
640
519
641
open_binding (
520
642
binding ,
0 commit comments