Skip to content

Python IndexError execution error in 03-training-formalization.ipynb #23

@hilliao

Description

@hilliao

Python error encountered executing the following line at [Extract train and eval splits]:

sql_query = datasource_utils.get_training_source_query(

sql_query = datasource_utils.get_training_source_query(
    PROJECT, REGION, DATASET_DISPLAY_NAME, ml_use='UNASSIGNED', limit=5000)

Observed error:

IndexError Traceback (most recent call last)
/tmp/ipykernel_1/1584844956.py in
1 print(DATASET_DISPLAY_NAME)
2 sql_query = datasource_utils.get_training_source_query(
----> 3 PROJECT, REGION, DATASET_DISPLAY_NAME, ml_use='UNASSIGNED', limit=5000)
4
5 output_config = example_gen_pb2.Output(

~/mlops-with-vertex-ai/src/common/datasource_utils.py in get_training_source_query(project, region, dataset_display_name, ml_use, limit)
55 dataset = vertex_ai.TabularDataset.list(
56 filter=f"display_name={dataset_display_name}", order_by="update_time"
---> 57 )[-1]
58 bq_source_uri = dataset.gca_resource.metadata["inputConfig"]["bigquerySource"][
59 "uri"

IndexError: list index out of range

I can't find .list method for google.cloud.aiplatform's TabularDataset in datasource_utils.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions