Skip to content

Commit 3134306

Browse files
committed
remove some unnecessary diffs
1 parent b7f0244 commit 3134306

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

examples/multiple_tables/terraform.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
project_id = "example-project"
12
delete_contents_on_destroy = true
23
default_table_expiration_ms = 3600000
34
dataset_labels = {

test/integration/data_warehouse/data_warehouse_test.go

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,28 +66,28 @@ func TestDataWarehouse(t *testing.T) {
6666
utils.Poll(t, verifyWorkflows, 8, 30*time.Second)
6767

6868
homeDir, err := os.UserHomeDir()
69-
if err != nil {
70-
log.Fatal(err)
71-
}
72-
file, err := os.Create(homeDir + "/.bigqueryrc")
73-
if err != nil {
74-
log.Fatal(err)
75-
}
76-
file.Close()
69+
if err != nil {
70+
log.Fatal(err)
71+
}
72+
file, err := os.Create(homeDir + "/.bigqueryrc")
73+
if err != nil {
74+
log.Fatal(err)
75+
}
76+
file.Close()
7777

7878
// Assert BigQuery tables & views are not empty
79-
test_tables := func() {
79+
test_tables := func (){
8080

8181
tables := []string{
82-
"thelook.distribution_centers",
83-
"thelook.events",
84-
"thelook.inventory_items",
85-
"thelook.order_items",
86-
"thelook.orders",
87-
"thelook.products",
88-
"thelook.users",
89-
"thelook.lookerstudio_report_distribution_centers",
90-
"thelook.lookerstudio_report_profit",
82+
"thelook.distribution_centers",
83+
"thelook.events",
84+
"thelook.inventory_items",
85+
"thelook.order_items",
86+
"thelook.orders",
87+
"thelook.products",
88+
"thelook.users",
89+
"thelook.lookerstudio_report_distribution_centers",
90+
"thelook.lookerstudio_report_profit",
9191
}
9292

9393
query_template := "SELECT COUNT(*) AS count_rows FROM `%[1]s.%[2]s`;"
@@ -108,6 +108,7 @@ func TestDataWarehouse(t *testing.T) {
108108

109109
// Assert BigQuery connection to Vertex GenAI was successfully created and works as expected
110110
test_llms := func() {
111+
111112
llm_query_template := "SELECT COUNT(*) AS count_rows FROM ML.GENERATE_TEXT(MODEL `%[1]s.thelook.text_generate_model`, (with clusters AS(SELECT CONCAT('cluster', CAST(centroid_id as STRING)) as centroid, avg_spend as average_spend, count_orders as count_of_orders, days_since_order FROM (SELECT centroid_id, feature, ROUND(numerical_value, 2) as value FROM ML.CENTROIDS(MODEL `%[1]s.thelook.customer_segment_clustering`)) PIVOT (SUM(value) FOR feature IN ('avg_spend', 'count_orders', 'days_since_order')) ORDER BY centroid_id) SELECT 'Pretend you are a creative strategist, given the following clusters come up with creative brand persona and title labels for each of these clusters, and explain step by step; what would be the next marketing step for these clusters' || ' ' || clusters.centroid || ', Average Spend $' || clusters.average_spend || ', Count of orders per person ' || clusters.count_of_orders || ', Days since last order ' || clusters.days_since_order AS prompt FROM clusters), STRUCT(800 AS max_output_tokens, 0.8 AS temperature, 40 AS top_k, 0.8 AS top_p, TRUE AS flatten_json_output));"
112113
query := fmt.Sprintf(llm_query_template, projectID)
113114
llm_op := bq.Runf(t, "--project_id=%[1]s --headless=true query --nouse_legacy_sql %[2]s", projectID, query)
@@ -116,9 +117,9 @@ func TestDataWarehouse(t *testing.T) {
116117
count_llm_kind := reflect.TypeOf(llm_count).Kind()
117118
llm_test_result := assert.Greater(llm_count, int64(0))
118119
if llm_test_result == true {
119-
} else {
120-
fmt.Printf("Some kind of error occurred while running the llm_count query. We think it has %[1]d rows. Here's some additional details: \n Query results. If this number is greater than 0, then there is probably an issue in the comparison: %[2]s \n Variable type for the count. This should be INT64: %[3]s \n ", llm_count, llm_op, count_llm_kind)
121-
}
120+
} else {
121+
fmt.Printf("Some kind of error occurred while running the llm_count query. We think it has %[1]d rows. Here's some additional details: \n Query results. If this number is greater than 0, then there is probably an issue in the comparison: %[2]s \n Variable type for the count. This should be INT64: %[3]s \n ", llm_count, llm_op, count_llm_kind)
122+
}
122123
}
123124
test_llms()
124125
})

0 commit comments

Comments
 (0)