Hey everyone, I’m having a weird issue with dbt.
I created this very simple model
/model.py
import pandas as pd
def model(dbt, session):
dbt.config(materialized = "table", packages = ["pandas"])
df = dbt.ref("i_reports").to_pandas()
return df
But when I run it, the following error occurs. It says there’s something wrong with the schema. I’ve already checked Snowflake, the correct schema is the first one, the second schema never existed in the database.
When I use the same query via sql it works. Does anyone have an idea what might be going on?
/model.sql
select * from {{ ref('i_reports') }}
Error
20:19:03 Snowflake adapter: Snowflake query id: 01ae0062-0001-b61c-0014-708703bd052e
20:19:03 Snowflake adapter: Snowflake error: 100357 (P0000): Python Interpreter Error:
Exception: [Snowflake Exception] arrow failed to build table from batches, errorInfo: Schema at index 1 was different:
FILE_CREATED_AT: timestamp[ns]
FILENAME: string
FILE_ROW_NUMBER: int16
START_SCAN_TIME: timestamp[ns, tz=America/Los_Angeles]
FLAG_KIT_VERSION_ID: string
PAUSED: bool
ROLE: string
COMPANY_ID: string
DATE_CREATED: timestamp[ns]
LAST_NAME: string
FRCA_DISCLOSURE_PASSWORD: string
MIDDLE_NAME: string
VISIBLE_PRIORITY: string
DELETED: bool
USER_ID: string
DATE_FINISHED: timestamp[ns]
REPORT_ID: string
FIRST_NAME: string
PERSON_ID: string
STATUS: string
DATE_MODIFIED: timestamp[ns]
UPDATE_TYPE: string
DATE_OF_BIRTH: timestamp[ns]
REVIEW_STATUS: string
PROFILES_CONFIRMED: bool
REPORT_CONFIRMED: bool
DUE_DATE: timestamp[ns]
INVESTIGATOR: bool
vs
FILE_CREATED_AT: timestamp[ns]
FILENAME: string
FILE_ROW_NUMBER: int16
START_SCAN_TIME: timestamp[ns, tz=America/Los_Angeles]
FLAG_KIT_VERSION_ID: string
PAUSED: bool
ROLE: string
COMPANY_ID: string
DATE_CREATED: timestamp[ns]
LAST_NAME: string
1 Like