From 0fbcd592cd7e9c4b0a131d777fa84e592a43a21c Mon Sep 17 00:00:00 2001 From: Alexey Volkov Date: Wed, 4 Aug 2021 10:51:07 -0700 Subject: [PATCH] fix: Fixed bug in TabularDataset.column_names (#590) Fixes https://github.com/googleapis/python-aiplatform/issues/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> --- google/cloud/aiplatform/datasets/tabular_dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/cloud/aiplatform/datasets/tabular_dataset.py b/google/cloud/aiplatform/datasets/tabular_dataset.py index 1fe23f5ee2..f9a9658d7e 100644 --- a/google/cloud/aiplatform/datasets/tabular_dataset.py +++ b/google/cloud/aiplatform/datasets/tabular_dataset.py @@ -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")