When running a k-means clustering model in BigQuery I am getting the following error message:
12:45:09 Completed with 1 error and 0 warnings:
12:45:09
12:45:09 Compilation Error in macro model_options (macros/materializations/model.sql)
12:45:09 'tuple object' has no attribute 'startswith'
12:45:09
12:45:09 > in macro bigquery__create_model_as (macros/materializations/model.sql)
12:45:09 > called by macro create_model_as (macros/materializations/model.sql)
12:45:09 > called by macro statement (macros/etc/statement.sql)
12:45:09 > called by macro materialization_model_bigquery (macros/materializations/model.sql)
12:45:10 > called by macro model_options (macros/materializations/model.sql)
The code is similar to the following:
{{
config(
materialized='model',
ml_config={
'model_type': 'kmeans',
'num_clusters': 3
}
)
}}
SELECT
userid,
average_number_clicks
FROM
{{ ref('stg_user_clicks') }}
GROUP BY 1
Fix
I managed to get this working locally by changing the code in the macros/materializations/model.sql file, and will submit a PR with the fix included.
Overview
When running a k-means clustering model in BigQuery I am getting the following error message:
The code is similar to the following:
Fix
I managed to get this working locally by changing the code in the
macros/materializations/model.sql
file, and will submit a PR with the fix included.