Welcome everybody!
The problem I’m having
I just started using python models and right on the first one I am experiencing some weird behaviour. My model bases on an SQL model (which I think is valid given the documentation here). However, when generating the .py file, it injects pure SQL into the code
Input (model.py)
def model(dbt, session):
dbt.config(materialized = "table")
df = dbt.ref("my-sql-model")
dx = df
...
Output (.py file on GCS)
from pyspark.sql import SparkSession
spark = SparkSession.builder.appName('smallTest').getOrCreate()
spark.conf.set("viewsEnabled","true")
spark.conf.set("temporaryGcsBucket","my-bucket-name")
with __dbt__cte__dictionary__xxx as (
select
something1 as column1,
something2 as column2
from
`my-project`.`my-dataset`.`my-table`
where
xxx
)def model(dbt, session):
dbt.config(materialized = "table")
import pandas as pd
df = dbt.ref("my-sql-model")
dx = df
Setup
BigQuery, GCS, dbt Cloud v1.3
There is not much I was able to do here as I really don’t understand where it is coming from. Did you ever face that issue before?