lavinigam-gcp / AI-ML-Patterns

Google Cloud AI/ML Patterns
MIT License
2 stars 7 forks source link

Unable to create a dataset through code in audience_segmentation_code.ipynb under feature engineering section #1

Open pondyasha opened 1 year ago

pondyasha commented 1 year ago

Creating a dataset with the following code DATASET_NAME = "ga_ecomm_feature_set" !bq mk $DATASET_NAME threw an invalid identifier error.

pondyasha commented 1 year ago

However, we can create a dataset using the following code:

dataset_name = "ga4_ecomm_feature_set" dataset_ref = client.dataset(dataset_name) dataset=bigquery.Dataset(dataset_ref) dataset = client.create_dataset(dataset) print(f"Created dataset {dataset.dataset_id}")

This code creates a new BigQuery client object, sets the name for the new dataset, gives a reference to the dataset, and uses the create_dataset() method to create the dataset in BigQuery. It then prints a message to confirm that the dataset was created successfully.