Skip to content

Commit

Permalink
Merge pull request #42 from gismart/empty_chunk
Browse files Browse the repository at this point in the history
Handle empty parquet chunk
  • Loading branch information
maxim-lisovsky-gismart authored May 12, 2023
2 parents 2c9eb23 + 99d8d14 commit 7e31719
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Add `--upgrade` option to update existing package to a new version
Specify package link in your `requirements.txt`:

```txt
git+https://github.com/gismart/[email protected].2#egg=bi-utils-gismart
git+https://github.com/gismart/[email protected].3#egg=bi-utils-gismart
```

### Usage
Expand Down
4 changes: 3 additions & 1 deletion bi_utils/aws/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,9 @@ def _read_chunks(
low_memory=False,
)
elif filename.lower().endswith(".parquet"):
chunk = pd.read_parquet(filename).astype(full_dtype)
chunk = pd.read_parquet(filename)
if not chunk.empty:
chunk = chunk.astype(full_dtype)
else:
raise ValueError(f"{os.path.basename(filename)} file extension is not supported")
if chunk.empty:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setuptools.setup(
name="bi-utils-gismart",
version="0.15.2",
version="0.15.3",
author="gismart",
author_email="[email protected]",
description="Utils for BI team",
Expand Down

0 comments on commit 7e31719

Please sign in to comment.