Skip to content

Commit 2836940

Browse files
authored
[source-MongoDB] Do not send estimate trace message if we don't have data (#37473)
1 parent 9b9ec1c commit 2836940

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

airbyte-integrations/connectors/source-mongodb-v2/metadata.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ data:
88
connectorSubtype: database
99
connectorType: source
1010
definitionId: b2e713cd-cc36-4c0a-b5bd-b47cb8a0561e
11-
dockerImageTag: 1.3.4
11+
dockerImageTag: 1.3.5
1212
dockerRepository: airbyte/source-mongodb-v2
1313
documentationUrl: https://docs.airbyte.com/integrations/sources/mongodb-v2
1414
githubIssueLabel: source-mongodb-v2

airbyte-integrations/connectors/source-mongodb-v2/src/main/java/io/airbyte/integrations/source/mongodb/MongoUtil.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ public static Optional<CollectionStatistics> getCollectionStatistics(final Mongo
186186
final Document stats = cursor.next();
187187
@SuppressWarnings("unchecked")
188188
final Map<String, Object> storageStats = (Map<String, Object>) stats.get(MongoConstants.STORAGE_STATS_KEY);
189-
if (storageStats != null && !storageStats.isEmpty()) {
189+
if (storageStats != null && !storageStats.isEmpty() && storageStats.containsKey(MongoConstants.COLLECTION_STATISTICS_COUNT_KEY)
190+
&& storageStats.containsKey(MongoConstants.COLLECTION_STATISTICS_STORAGE_SIZE_KEY)) {
190191
return Optional.of(new CollectionStatistics((Number) storageStats.get(MongoConstants.COLLECTION_STATISTICS_COUNT_KEY),
191192
(Number) storageStats.get(MongoConstants.COLLECTION_STATISTICS_STORAGE_SIZE_KEY)));
192193
} else {

docs/integrations/sources/mongodb-v2.md

+1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ For more information regarding configuration parameters, please see [MongoDb Doc
221221

222222
| Version | Date | Pull Request | Subject |
223223
|:--------|:-----------|:---------------------------------------------------------|:----------------------------------------------------------------------------------------------------------|
224+
| 1.3.5 | 2024-04-22 | [37348](https://github.com/airbytehq/airbyte/pull/37348) | Do not send estimate trace if we do not have data. |
224225
| 1.3.4 | 2024-04-16 | [37348](https://github.com/airbytehq/airbyte/pull/37348) | Populate null values in airbyte record messages. |
225226
| 1.3.3 | 2024-04-05 | [36872](https://github.com/airbytehq/airbyte/pull/36872) | Update to connector's metadat definition. |
226227
| 1.3.2 | 2024-04-04 | [36845](https://github.com/airbytehq/airbyte/pull/36845) | Adopt Kotlin CDK. |

0 commit comments

Comments
 (0)