@@ -40,16 +40,7 @@ class JiraStream(HttpStream, ABC):
40
40
41
41
primary_key = "id"
42
42
parse_response_root = None
43
-
44
- # To prevent dangerous behavior, the `vcr` library prohibits the use of nested caching.
45
- # Here's an example of dangerous behavior:
46
- # cache = Cassette.use('whatever')
47
- # with cache:
48
- # with cache:
49
- # pass
50
- #
51
- # Therefore, we will only use `cache` for the top-level stream, so as not to cause possible difficulties.
52
- top_level_stream = True
43
+ use_request_cache = True
53
44
54
45
def __init__ (self , domain : str , projects : List [str ], ** kwargs ):
55
46
super (JiraStream , self ).__init__ (** kwargs )
@@ -97,7 +88,7 @@ def request_headers(
97
88
return {"Accept" : "application/json" }
98
89
99
90
def read_records (self , ** kwargs ) -> Iterable [Mapping [str , Any ]]:
100
- if self .top_level_stream :
91
+ if self .use_request_cache :
101
92
with self ._cache :
102
93
yield from super ().read_records (** kwargs )
103
94
else :
@@ -206,7 +197,7 @@ class BoardIssues(V1ApiJiraStream, IncrementalJiraStream):
206
197
207
198
cursor_field = "updated"
208
199
parse_response_root = "issues"
209
- top_level_stream = False
200
+ use_request_cache = False
210
201
211
202
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
212
203
board_id = stream_slice ["board_id" ]
@@ -280,7 +271,7 @@ class EpicIssues(IncrementalJiraStream):
280
271
281
272
cursor_field = "updated"
282
273
parse_response_root = "issues"
283
- top_level_stream = False
274
+ use_request_cache = False
284
275
285
276
def __init__ (self , start_date : str = "" , ** kwargs ):
286
277
super ().__init__ (** kwargs )
@@ -325,7 +316,7 @@ class FilterSharing(JiraStream):
325
316
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-filter-sharing/#api-rest-api-3-filter-id-permission-get
326
317
"""
327
318
328
- top_level_stream = False
319
+ use_request_cache = False
329
320
330
321
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
331
322
filter_id = stream_slice ["filter_id" ]
@@ -396,7 +387,7 @@ class IssueComments(JiraStream):
396
387
"""
397
388
398
389
parse_response_root = "comments"
399
- top_level_stream = False
390
+ use_request_cache = False
400
391
401
392
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
402
393
key = stream_slice ["key" ]
@@ -437,7 +428,7 @@ class IssueCustomFieldContexts(JiraStream):
437
428
"""
438
429
439
430
parse_response_root = "values"
440
- top_level_stream = False
431
+ use_request_cache = False
441
432
442
433
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
443
434
field_id = stream_slice ["field_id" ]
@@ -511,7 +502,7 @@ class IssueProperties(JiraStream):
511
502
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-properties/#api-rest-api-3-issue-issueidorkey-properties-propertykey-get
512
503
"""
513
504
514
- top_level_stream = False
505
+ use_request_cache = False
515
506
516
507
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
517
508
key = stream_slice ["key" ]
@@ -531,7 +522,7 @@ class IssueRemoteLinks(JiraStream):
531
522
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-remote-links/#api-rest-api-3-issue-issueidorkey-remotelink-get
532
523
"""
533
524
534
- top_level_stream = False
525
+ use_request_cache = False
535
526
536
527
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
537
528
key = stream_slice ["key" ]
@@ -596,7 +587,7 @@ class IssueVotes(JiraStream):
596
587
"""
597
588
598
589
# parse_response_root = "voters"
599
- top_level_stream = False
590
+ use_request_cache = False
600
591
601
592
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
602
593
key = stream_slice ["key" ]
@@ -616,7 +607,7 @@ class IssueWatchers(JiraStream):
616
607
"""
617
608
618
609
# parse_response_root = "watchers"
619
- top_level_stream = False
610
+ use_request_cache = False
620
611
621
612
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
622
613
key = stream_slice ["key" ]
@@ -634,7 +625,7 @@ class IssueWorklogs(JiraStream):
634
625
"""
635
626
636
627
parse_response_root = "worklogs"
637
- top_level_stream = False
628
+ use_request_cache = False
638
629
639
630
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
640
631
key = stream_slice ["key" ]
@@ -713,7 +704,7 @@ class ProjectAvatars(JiraStream):
713
704
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-avatars/#api-rest-api-3-project-projectidorkey-avatars-get
714
705
"""
715
706
716
- top_level_stream = False
707
+ use_request_cache = False
717
708
718
709
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
719
710
key = stream_slice ["key" ]
@@ -745,7 +736,7 @@ class ProjectComponents(JiraStream):
745
736
"""
746
737
747
738
parse_response_root = "values"
748
- top_level_stream = False
739
+ use_request_cache = False
749
740
750
741
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
751
742
key = stream_slice ["key" ]
@@ -762,7 +753,7 @@ class ProjectEmail(JiraStream):
762
753
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-email/#api-rest-api-3-project-projectid-email-get
763
754
"""
764
755
765
- top_level_stream = False
756
+ use_request_cache = False
766
757
767
758
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
768
759
project_id = stream_slice ["project_id" ]
@@ -779,7 +770,7 @@ class ProjectPermissionSchemes(JiraStream):
779
770
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-permission-schemes/#api-rest-api-3-project-projectkeyorid-securitylevel-get
780
771
"""
781
772
782
- top_level_stream = False
773
+ use_request_cache = False
783
774
784
775
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
785
776
key = stream_slice ["key" ]
@@ -806,7 +797,7 @@ class ProjectVersions(JiraStream):
806
797
"""
807
798
808
799
parse_response_root = "values"
809
- top_level_stream = False
800
+ use_request_cache = False
810
801
811
802
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
812
803
key = stream_slice ["key" ]
@@ -834,7 +825,7 @@ class ScreenTabs(JiraStream):
834
825
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-tabs/#api-rest-api-3-screens-screenid-tabs-get
835
826
"""
836
827
837
- top_level_stream = False
828
+ use_request_cache = False
838
829
839
830
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
840
831
screen_id = stream_slice ["screen_id" ]
@@ -855,7 +846,7 @@ class ScreenTabFields(JiraStream):
855
846
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-tab-fields/#api-rest-api-3-screens-screenid-tabs-tabid-fields-get
856
847
"""
857
848
858
- top_level_stream = False
849
+ use_request_cache = False
859
850
860
851
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
861
852
screen_id = stream_slice ["screen_id" ]
@@ -906,7 +897,7 @@ class SprintIssues(V1ApiJiraStream, IncrementalJiraStream):
906
897
907
898
cursor_field = "updated"
908
899
parse_response_root = "issues"
909
- top_level_stream = False
900
+ use_request_cache = False
910
901
911
902
def path (self , stream_slice : Mapping [str , Any ] = None , ** kwargs ) -> str :
912
903
sprint_id = stream_slice ["sprint_id" ]
0 commit comments