Skip to content

Commit 58c9b84

Browse files
authored
🐛 CDK: fix number of records mismatch (#5767)
* CDK: fix number of records mismatch Increment `record_counter` after we check whether we reached the limit or not. * Update docs. Bump version to 0.1.17
1 parent 95171b8 commit 58c9b84

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

airbyte-cdk/python/CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Changelog
22

3+
## 0.1.17
4+
Fix mismatching between number of records actually read and number of records in logs by 1: https://github.com/airbytehq/airbyte/pull/5767
5+
36
## 0.1.16
4-
Update generated AirbyteProtocol models to contain [Oauth changes](https://github.com/airbytehq/airbyte/pull/5776).
7+
Update generated AirbyteProtocol models to contain [Oauth changes](https://github.com/airbytehq/airbyte/pull/5776).
58

69
## 0.1.15
710
Add \_limit and \_page_size as internal config parameters for SAT

airbyte-cdk/python/airbyte_cdk/sources/abstract_source.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ def _read_stream(
146146
logger.info(f"Syncing stream: {stream_name} ")
147147
for record in record_iterator:
148148
if record.type == MessageType.RECORD:
149-
record_counter += 1
150-
if internal_config.limit and record_counter > internal_config.limit:
149+
if internal_config.limit and record_counter >= internal_config.limit:
151150
logger.info(f"Reached limit defined by internal config ({internal_config.limit}), stop reading")
152151
break
152+
record_counter += 1
153153
yield record
154154

155155
logger.info(f"Read {record_counter} records from {stream_name} stream")

airbyte-cdk/python/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
setup(
3737
name="airbyte-cdk",
38-
version="0.1.16",
38+
version="0.1.17",
3939
description="A framework for writing Airbyte Connectors.",
4040
long_description=README,
4141
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)