Skip to content

Commit

Permalink
fix: Fixed bug in TabularDataset.column_names (#590)
Browse files Browse the repository at this point in the history
Fixes #589

The `end` parameter of the `blob.download_as_bytes` function is inclusive, not exclusive.

> There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors.

Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com>
  • Loading branch information
Ark-kun and gcf-merge-on-green[bot] committed Aug 4, 2021
1 parent 2f138d1 commit 0fbcd59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion google/cloud/aiplatform/datasets/tabular_dataset.py
Expand Up @@ -150,7 +150,7 @@ def _retrieve_gcs_source_columns(

while first_new_line_index == -1:
line += blob.download_as_bytes(
start=start_index, end=start_index + increment
start=start_index, end=start_index + increment - 1
).decode("utf-8")

first_new_line_index = line.find("\n")
Expand Down

0 comments on commit 0fbcd59

Please sign in to comment.