Skip to content

Commit

Permalink
fix(mongo): igore index when concatenating chunks (#1825)
Browse files Browse the repository at this point in the history
  • Loading branch information
fspot authored Nov 20, 2024
1 parent 2160e20 commit e49f014
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

## Unreleased

### Fixed

- Mongo: when reading data by chunk, ignore each individual chunk index when concatenating them.

## [7.3.1] 2024-11-14

### Fixed

- Mongo: correctly type the aggregation pipeline, expected when `query` is a `list`


## [7.3.0] 2024-11-13

### Added
Expand Down
2 changes: 1 addition & 1 deletion toucan_connectors/mongo/mongo_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def _retrieve_data(self, data_source, chunk_size: int | None = None):
chunks = []
while (chunk := list(itertools.islice(data, chunk_size))):
chunks.append(pd.DataFrame.from_records(chunk))
return pd.concat(chunks) if chunks else pd.DataFrame()
return pd.concat(chunks, ignore_index=True) if chunks else pd.DataFrame()
else:
return pd.DataFrame.from_records(data)

Expand Down

0 comments on commit e49f014

Please sign in to comment.