Skip to content

Commit

Permalink
fix: Fixed bug in TabularDataset.column_names
Browse files Browse the repository at this point in the history
Fixes googleapis#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.
  • Loading branch information
Ark-kun authored Aug 3, 2021
1 parent 193ef7d commit 3a482e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion google/cloud/aiplatform/datasets/tabular_dataset.py
Original file line number Diff line number Diff line change
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 3a482e4

Please sign in to comment.