airbyte-cdk 6.12.0rc1__py3-none-any.whl → 6.12.1.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1897,56 +1897,6 @@ definitions:
1897
1897
  $parameters:
1898
1898
  type: object
1899
1899
  additionalProperties: true
1900
- ZipfileDecoder:
1901
- title: Zipfile Decoder
1902
- description: Decoder for response data that is returned as zipfile(s).
1903
- type: object
1904
- additionalProperties: true
1905
- required:
1906
- - type
1907
- properties:
1908
- type:
1909
- type: string
1910
- enum: [ZipfileDecoder]
1911
- parser:
1912
- title: Parser
1913
- description: Parser to parse the decompressed data from the zipfile(s).
1914
- anyOf:
1915
- - "$ref": "#/definitions/JsonParser"
1916
- - "$ref": "#/definitions/CustomParser"
1917
- JsonParser:
1918
- title: JsonParser
1919
- description: Parser used for parsing str, bytes, or bytearray data and returning data in a dictionary format.
1920
- type: object
1921
- additionalProperties: true
1922
- required:
1923
- - type
1924
- properties:
1925
- type:
1926
- type: string
1927
- enum: [JsonParser]
1928
- CustomParser:
1929
- title: Custom Parser
1930
- description: Use this to implement custom parser logic.
1931
- type: object
1932
- additionalProperties: true
1933
- required:
1934
- - type
1935
- - class_name
1936
- properties:
1937
- type:
1938
- type: string
1939
- enum: [CustomParser]
1940
- class_name:
1941
- title: Class Name
1942
- description: Fully-qualified name of the class that will be implementing the custom decoding. Has to be a sub class of Parser. The format is `source_<name>.<package>.<class_name>`.
1943
- type: string
1944
- additionalProperties: true
1945
- examples:
1946
- - "source_rivendell.components.ElvishParser"
1947
- $parameters:
1948
- type: object
1949
- additionalProperties: true
1950
1900
  ListPartitionRouter:
1951
1901
  title: List Partition Router
1952
1902
  description: A Partition router that specifies a list of attributes where each attribute describes a portion of the complete data set for a stream. During a sync, each value is iterated over and can be used as input to outbound API requests.
@@ -7,6 +7,5 @@ from airbyte_cdk.sources.declarative.decoders.json_decoder import JsonDecoder, J
7
7
  from airbyte_cdk.sources.declarative.decoders.noop_decoder import NoopDecoder
8
8
  from airbyte_cdk.sources.declarative.decoders.pagination_decoder_decorator import PaginationDecoderDecorator
9
9
  from airbyte_cdk.sources.declarative.decoders.xml_decoder import XmlDecoder
10
- from airbyte_cdk.sources.declarative.decoders.zipfile_decoder import ZipfileDecoder
11
10
 
12
- __all__ = ["Decoder", "JsonDecoder", "JsonlDecoder", "IterableDecoder", "GzipJsonDecoder", "NoopDecoder", "PaginationDecoderDecorator", "XmlDecoder", "ZipfileDecoder"]
11
+ __all__ = ["Decoder", "JsonDecoder", "JsonlDecoder", "IterableDecoder", "GzipJsonDecoder", "NoopDecoder", "PaginationDecoderDecorator", "XmlDecoder"]
@@ -741,27 +741,6 @@ class GzipJsonDecoder(BaseModel):
741
741
  parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
742
742
 
743
743
 
744
- class JsonParser(BaseModel):
745
- class Config:
746
- extra = Extra.allow
747
-
748
- type: Literal["JsonParser"]
749
-
750
-
751
- class CustomParser(BaseModel):
752
- class Config:
753
- extra = Extra.allow
754
-
755
- type: Literal["CustomParser"]
756
- class_name: str = Field(
757
- ...,
758
- description="Fully-qualified name of the class that will be implementing the custom decoding. Has to be a sub class of Parser. The format is `source_<name>.<package>.<class_name>`.",
759
- examples=["source_rivendell.components.ElvishParser"],
760
- title="Class Name",
761
- )
762
- parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
763
-
764
-
765
744
  class MinMaxDatetime(BaseModel):
766
745
  type: Literal["MinMaxDatetime"]
767
746
  datetime: str = Field(
@@ -1489,18 +1468,6 @@ class SessionTokenRequestApiKeyAuthenticator(BaseModel):
1489
1468
  )
1490
1469
 
1491
1470
 
1492
- class ZipfileDecoder(BaseModel):
1493
- class Config:
1494
- extra = Extra.allow
1495
-
1496
- type: Literal["ZipfileDecoder"]
1497
- parser: Optional[Union[JsonParser, CustomParser]] = Field(
1498
- None,
1499
- description="Parser to parse the decompressed data from the zipfile(s).",
1500
- title="Parser",
1501
- )
1502
-
1503
-
1504
1471
  class ListPartitionRouter(BaseModel):
1505
1472
  type: Literal["ListPartitionRouter"]
1506
1473
  cursor_field: str = Field(
@@ -66,9 +66,7 @@ from airbyte_cdk.sources.declarative.decoders import (
66
66
  JsonlDecoder,
67
67
  PaginationDecoderDecorator,
68
68
  XmlDecoder,
69
- ZipfileDecoder,
70
69
  )
71
- from airbyte_cdk.sources.declarative.decoders.parsers import JsonParser
72
70
  from airbyte_cdk.sources.declarative.extractors import (
73
71
  DpathExtractor,
74
72
  RecordFilter,
@@ -226,9 +224,6 @@ from airbyte_cdk.sources.declarative.models.declarative_component_schema import
226
224
  from airbyte_cdk.sources.declarative.models.declarative_component_schema import (
227
225
  JsonlDecoder as JsonlDecoderModel,
228
226
  )
229
- from airbyte_cdk.sources.declarative.models.declarative_component_schema import (
230
- JsonParser as JsonParserModel,
231
- )
232
227
  from airbyte_cdk.sources.declarative.models.declarative_component_schema import (
233
228
  JwtAuthenticator as JwtAuthenticatorModel,
234
229
  )
@@ -321,9 +316,6 @@ from airbyte_cdk.sources.declarative.models.declarative_component_schema import
321
316
  from airbyte_cdk.sources.declarative.models.declarative_component_schema import (
322
317
  XmlDecoder as XmlDecoderModel,
323
318
  )
324
- from airbyte_cdk.sources.declarative.models.declarative_component_schema import (
325
- ZipfileDecoder as ZipfileDecoderModel,
326
- )
327
319
  from airbyte_cdk.sources.declarative.partition_routers import (
328
320
  CartesianProductStreamSlicer,
329
321
  ListPartitionRouter,
@@ -478,7 +470,6 @@ class ModelToComponentFactory:
478
470
  InlineSchemaLoaderModel: self.create_inline_schema_loader,
479
471
  JsonDecoderModel: self.create_json_decoder,
480
472
  JsonlDecoderModel: self.create_jsonl_decoder,
481
- JsonParserModel: self.create_json_parser,
482
473
  GzipJsonDecoderModel: self.create_gzipjson_decoder,
483
474
  KeysToLowerModel: self.create_keys_to_lower_transformation,
484
475
  IterableDecoderModel: self.create_iterable_decoder,
@@ -514,7 +505,6 @@ class ModelToComponentFactory:
514
505
  ConfigComponentsResolverModel: self.create_config_components_resolver,
515
506
  StreamConfigModel: self.create_stream_config,
516
507
  ComponentMappingDefinitionModel: self.create_components_mapping_definition,
517
- ZipfileDecoderModel: self.create_zipfile_decoder,
518
508
  }
519
509
 
520
510
  # Needed for the case where we need to perform a second parse on the fields of a custom component
@@ -1692,20 +1682,6 @@ class ModelToComponentFactory:
1692
1682
  ) -> GzipJsonDecoder:
1693
1683
  return GzipJsonDecoder(parameters={}, encoding=model.encoding)
1694
1684
 
1695
- def create_zipfile_decoder(
1696
- self, model: ZipfileDecoderModel, config: Config, **kwargs: Any
1697
- ) -> ZipfileDecoder:
1698
- parser = (
1699
- self._create_component_from_model(model=model.parser, config=config)
1700
- if model.parser
1701
- else None
1702
- )
1703
- return ZipfileDecoder(parameters={}, parser=parser)
1704
-
1705
- @staticmethod
1706
- def create_json_parser(model: JsonParserModel, config: Config, **kwargs: Any) -> JsonParser:
1707
- return JsonParser(parameters={})
1708
-
1709
1685
  @staticmethod
1710
1686
  def create_json_file_schema_loader(
1711
1687
  model: JsonFileSchemaLoaderModel, config: Config, **kwargs: Any
@@ -223,17 +223,17 @@ class Stream(ABC):
223
223
  record_counter += 1
224
224
 
225
225
  checkpoint_interval = self.state_checkpoint_interval
226
- checkpoint = checkpoint_reader.get_checkpoint()
227
226
  if (
228
227
  should_checkpoint
229
228
  and checkpoint_interval
230
229
  and record_counter % checkpoint_interval == 0
231
- and checkpoint is not None
232
230
  ):
233
- airbyte_state_message = self._checkpoint_state(
234
- checkpoint, state_manager=state_manager
235
- )
236
- yield airbyte_state_message
231
+ checkpoint = checkpoint_reader.get_checkpoint()
232
+ if checkpoint:
233
+ airbyte_state_message = self._checkpoint_state(
234
+ checkpoint, state_manager=state_manager
235
+ )
236
+ yield airbyte_state_message
237
237
 
238
238
  if internal_config.is_limit_reached(record_counter):
239
239
  break
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.12.0rc1
3
+ Version: 6.12.1.dev0
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -66,18 +66,15 @@ airbyte_cdk/sources/declarative/concurrent_declarative_source.py,sha256=PxP4p268
66
66
  airbyte_cdk/sources/declarative/datetime/__init__.py,sha256=l9LG7Qm6e5r_qgqfVKnx3mXYtg1I9MmMjomVIPfU4XA,177
67
67
  airbyte_cdk/sources/declarative/datetime/datetime_parser.py,sha256=SX9JjdesN1edN2WVUVMzU_ptqp2QB1OnsnjZ4mwcX7w,2579
68
68
  airbyte_cdk/sources/declarative/datetime/min_max_datetime.py,sha256=0BHBtDNQZfvwM45-tY5pNlTcKAFSGGNxemoi0Jic-0E,5785
69
- airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=aW6LC_YuqlqqCiRgBKm7ecNsF_0iPi1NF8sDmiq6wsA,130106
69
+ airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=bmuzrO0q4yeRXXkAMAFdzgtDx2gF8-k8ERq2MqVMgq4,128593
70
70
  airbyte_cdk/sources/declarative/declarative_source.py,sha256=nF7wBqFd3AQmEKAm4CnIo29CJoQL562cJGSCeL8U8bA,1531
71
71
  airbyte_cdk/sources/declarative/declarative_stream.py,sha256=JRyNeOIpsFu4ztVZsN6sncqUEIqIE-bUkD2TPgbMgk0,10375
72
- airbyte_cdk/sources/declarative/decoders/__init__.py,sha256=q4XSJFXbVYgXoal910hrCL6t-EQLBtLUq4gvP1eNW9o,773
72
+ airbyte_cdk/sources/declarative/decoders/__init__.py,sha256=hNlhaB5FjNC6IfJyglj5ZJWkYD2nEAukMDmzRz5PC6o,671
73
73
  airbyte_cdk/sources/declarative/decoders/decoder.py,sha256=sl-Gt8lXi7yD2Q-sD8je5QS2PbgrgsYjxRLWsay7DMc,826
74
74
  airbyte_cdk/sources/declarative/decoders/json_decoder.py,sha256=qdbjeR6RffKaah_iWvMsOcDolYuxJY5DaI3b9AMTZXg,3327
75
75
  airbyte_cdk/sources/declarative/decoders/noop_decoder.py,sha256=iZh0yKY_JzgBnJWiubEusf5c0o6Khd-8EWFWT-8EgFo,542
76
76
  airbyte_cdk/sources/declarative/decoders/pagination_decoder_decorator.py,sha256=ZVBZhAOl0I0MymXN5CKTC-kIXG4GuUQAEyn0XpUDuSE,1081
77
- airbyte_cdk/sources/declarative/decoders/parsers/__init__.py,sha256=3qvAJF3O2Ie0qK5ANgsEKR136t7HKk53rR_FyO8ihuY,186
78
- airbyte_cdk/sources/declarative/decoders/parsers/parsers.py,sha256=Xlz4xmRYAtMFqdvAMwEdTxh-90glKlijMEm6qLOyuAs,1257
79
77
  airbyte_cdk/sources/declarative/decoders/xml_decoder.py,sha256=EU-7t-5vIGRHZ14h-f0GUE4V5-eTM9Flux-A8xgI1Rc,3117
80
- airbyte_cdk/sources/declarative/decoders/zipfile_decoder.py,sha256=IPLCgYpab6og6j7BdvBuhn_7c1ZYyg8yu48DPkvA84c,1752
81
78
  airbyte_cdk/sources/declarative/exceptions.py,sha256=kTPUA4I2NV4J6HDz-mKPGMrfuc592akJnOyYx38l_QM,176
82
79
  airbyte_cdk/sources/declarative/extractors/__init__.py,sha256=YFuL4D4RuuB8E1DNSbJNIj0_HApOlyECoJ_s8DuJMeI,611
83
80
  airbyte_cdk/sources/declarative/extractors/dpath_extractor.py,sha256=wR4Ol4MG2lt5UlqXF5EU_k7qa5cN4_-luu3PJ1PlO3A,3131
@@ -107,12 +104,12 @@ airbyte_cdk/sources/declarative/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW
107
104
  airbyte_cdk/sources/declarative/migrations/legacy_to_per_partition_state_migration.py,sha256=iemy3fKLczcU0-Aor7tx5jcT6DRedKMqyK7kCOp01hg,3924
108
105
  airbyte_cdk/sources/declarative/migrations/state_migration.py,sha256=KWPjealMLKSMtajXgkdGgKg7EmTLR-CqqD7UIh0-eDU,794
109
106
  airbyte_cdk/sources/declarative/models/__init__.py,sha256=nUFxNCiKeYRVXuZEKA7GD-lTHxsiKcQ8FitZjKhPIvE,100
110
- airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=94efE5chOvaQaBTRx-Hxu2xyN6mDZ7DuFWJUH5fOgWY,91690
107
+ airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=-XTzt8EY23Qel7KZINQIbQOoBWqdiK6am-p7A615AI0,90753
111
108
  airbyte_cdk/sources/declarative/parsers/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQyRMXTs4GTvlRi3ImKnIioo,61
112
109
  airbyte_cdk/sources/declarative/parsers/custom_exceptions.py,sha256=Rir9_z3Kcd5Es0-LChrzk-0qubAsiK_RSEnLmK2OXm8,553
113
110
  airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py,sha256=CXwTfD3wSQq3okcqwigpprbHhSURUokh4GK2OmOyKC8,9132
114
111
  airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py,sha256=IWUOdF03o-aQn0Occo1BJCxU0Pz-QILk5L67nzw2thw,6803
115
- airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=62HI4jMJE7EUJY8GLuGL33mfBmfP7zVSnoLcdyTlwYw,105328
112
+ airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=UWUlj6m2WT9SspMtvvhni31FoQBrkqnHGzrwFKem-Qc,104367
116
113
  airbyte_cdk/sources/declarative/partition_routers/__init__.py,sha256=1NjaZoGAIefvWwj6wx-LOKIXXWS-UnBlZFnuR7y6uYA,745
117
114
  airbyte_cdk/sources/declarative/partition_routers/cartesian_product_stream_slicer.py,sha256=c5cuVFM6NFkuQqG8Z5IwkBuwDrvXZN1CunUOM_L0ezg,6892
118
115
  airbyte_cdk/sources/declarative/partition_routers/list_partition_router.py,sha256=t7pRdFWfFWJtQQG19c9PVeMODyO2BknRTakpM5U9N-8,4844
@@ -267,7 +264,7 @@ airbyte_cdk/sources/streams/concurrent/partitions/types.py,sha256=frPVvHtY7vLxpG
267
264
  airbyte_cdk/sources/streams/concurrent/state_converters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
268
265
  airbyte_cdk/sources/streams/concurrent/state_converters/abstract_stream_state_converter.py,sha256=CXHUMOhndu-LOKgsnNTItv5s5qrKpmJDeHOzlH1nBy8,6819
269
266
  airbyte_cdk/sources/streams/concurrent/state_converters/datetime_stream_state_converter.py,sha256=syjdxEoElIOzqVS5Jrm5FOR70jsbBdttEO_3Iz12Jyo,7523
270
- airbyte_cdk/sources/streams/core.py,sha256=z4Oi5qmJPjs-RdMd5tPWHvHqIjkcxhkVKTvIpfAs2uA,32211
267
+ airbyte_cdk/sources/streams/core.py,sha256=jiYW6w8cjNjzXMd8U8Gt-02fYYU7b0ciXSSSnGvFRak,32219
271
268
  airbyte_cdk/sources/streams/http/__init__.py,sha256=NXaNlkzZMkh5kS8S5ujEaKEE6855sk6_HljF_GFjKZI,311
272
269
  airbyte_cdk/sources/streams/http/availability_strategy.py,sha256=sovoGFThZr-doMN9vJvTuJBrvkwQVIO0qTQO64pGZPY,2428
273
270
  airbyte_cdk/sources/streams/http/error_handlers/__init__.py,sha256=R8OgTcratGH4f6BbYM2Hp8qYyEk7wMYuyda5H9ohGW8,665
@@ -339,8 +336,8 @@ airbyte_cdk/utils/slice_hasher.py,sha256=-pHexlNYoWYPnXNH-M7HEbjmeJe9Zk7SJijdQ7d
339
336
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
340
337
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
341
338
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
342
- airbyte_cdk-6.12.0rc1.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
343
- airbyte_cdk-6.12.0rc1.dist-info/METADATA,sha256=Dmtuhf6DiAt2U3kmIQjlVuruZToq8QNPhsqtZvUePAE,5953
344
- airbyte_cdk-6.12.0rc1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
345
- airbyte_cdk-6.12.0rc1.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
346
- airbyte_cdk-6.12.0rc1.dist-info/RECORD,,
339
+ airbyte_cdk-6.12.1.dev0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
340
+ airbyte_cdk-6.12.1.dev0.dist-info/METADATA,sha256=wuEYLVSyehdNYlyYVlLw9n2uOyx1aT_WRmRnDlfHu0s,5955
341
+ airbyte_cdk-6.12.1.dev0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
342
+ airbyte_cdk-6.12.1.dev0.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
343
+ airbyte_cdk-6.12.1.dev0.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- #
2
- # Copyright (c) 2024 Airbyte, Inc., all rights reserved.
3
- #
4
-
5
- from airbyte_cdk.sources.declarative.decoders.parsers.parsers import Parser, JsonParser
6
-
7
- __all__ = ["Parser", "JsonParser"]
@@ -1,49 +0,0 @@
1
- #
2
- # Copyright (c) 2024 Airbyte, Inc., all rights reserved.
3
- #
4
-
5
- import json
6
- import logging
7
- from abc import abstractmethod
8
- from dataclasses import InitVar, dataclass
9
- from typing import Any, Generator, Mapping, MutableMapping, Union
10
-
11
- logger = logging.getLogger("airbyte")
12
-
13
-
14
- @dataclass
15
- class Parser:
16
- """
17
- Parser strategy to convert str, bytes, or bytearray data into MutableMapping[str, Any].
18
- """
19
-
20
- @abstractmethod
21
- def parse(
22
- self, data: Union[str, bytes, bytearray]
23
- ) -> Generator[MutableMapping[str, Any], None, None]:
24
- pass
25
-
26
-
27
- @dataclass
28
- class JsonParser(Parser):
29
- """
30
- Parser strategy for converting JSON-structure str, bytes, or bytearray data into MutableMapping[str, Any].
31
- """
32
-
33
- parameters: InitVar[Mapping[str, Any]]
34
-
35
- def parse(
36
- self, data: Union[str, bytes, bytearray]
37
- ) -> Generator[MutableMapping[str, Any], None, None]:
38
- try:
39
- body_json = json.loads(data)
40
- except json.JSONDecodeError:
41
- logger.warning(f"Data cannot be parsed into json: {data=}")
42
- yield {}
43
-
44
- if not isinstance(body_json, list):
45
- body_json = [body_json]
46
- if len(body_json) == 0:
47
- yield {}
48
- else:
49
- yield from body_json
@@ -1,54 +0,0 @@
1
- #
2
- # Copyright (c) 2024 Airbyte, Inc., all rights reserved.
3
- #
4
-
5
- import gzip
6
- import io
7
- import logging
8
- import zipfile
9
- from dataclasses import InitVar, dataclass
10
- from typing import Any, Generator, Mapping, MutableMapping, Optional
11
-
12
- import requests
13
-
14
- from airbyte_cdk.sources.declarative.decoders import Decoder
15
- from airbyte_cdk.sources.declarative.decoders.parsers import JsonParser, Parser
16
-
17
- logger = logging.getLogger("airbyte")
18
-
19
-
20
- @dataclass
21
- class ZipfileDecoder(Decoder):
22
- parameters: InitVar[Mapping[str, Any]]
23
- parser: Optional[Parser] = None
24
-
25
- def __post_init__(self, parameters: Mapping[str, Any]) -> None:
26
- self._parser = (
27
- self.parser(parameters=parameters) if self.parser else JsonParser(parameters=parameters)
28
- )
29
-
30
- def is_stream_response(self) -> bool:
31
- return False
32
-
33
- def decode(
34
- self, response: requests.Response
35
- ) -> Generator[MutableMapping[str, Any], None, None]:
36
- try:
37
- zip_file = zipfile.ZipFile(io.BytesIO(response.content))
38
- except zipfile.BadZipFile as e:
39
- logger.exception(e)
40
- logger.error(
41
- f"Received an invalid zip file in response to URL: {response.request.url}. "
42
- f"The size of the response body is: {len(response.content)}"
43
- )
44
- yield {}
45
-
46
- for gzip_filename in zip_file.namelist():
47
- with zip_file.open(gzip_filename) as file:
48
- try:
49
- for data in gzip.open(file):
50
- yield from self._parser.parse(data)
51
- except gzip.BadGzipFile as e:
52
- logger.exception(e)
53
- logger.error(f"Fail to read contents of zipped response: {e}")
54
- yield {}