dbt-labs / dbt-external-tables

dbt macros to stage external sources
https://hub.getdbt.com/dbt-labs/dbt_external_tables/latest/
Apache License 2.0
297 stars 119 forks source link

'module object' has no attribute 'PRINTER_WIDTH' #128

Closed timbrownsf closed 2 years ago

timbrownsf commented 2 years ago

Describe the bug

When trying to run stage_external_sources, I receive the error 'module object' has no attribute 'PRINTER_WIDTH'

Steps to reproduce

Running with dbt=0.20.0 Installing dbt-labs/dbt_external_tables@0.8.0 Installed from version 0.8.0

run dbt run-operation stage_external_sources

Expected results

It runs the external operations

Actual results

It errors out

Screenshots and log output

➜  shef-etl git:(tim/customerio-data) ✗ dbt run-operation stage_external_sources --args 'select: setl_tim.stream_customer_io_attributes' --vars "ext_full_refresh: true"
Running with dbt=0.20.0
* Deprecation Warning: The "packages" argument of adapter.dispatch() has been
deprecated. Use the "macro_namespace" argument instead.
Raised during dispatch for: except
For more information, see:
https://docs.getdbt.com/reference/dbt-jinja-functions/dispatch
1 of 1 START external source setl_tim.stream_customer_io_attributes
Encountered an error while running operation: Compilation Error in macro stage_external_sources (macros/common/stage_external_sources.sql)
  'module object' has no attribute 'PRINTER_WIDTH'

System information

packages:
  - package: dbt-labs/dbt_external_tables
    version: 0.8.0

Which database are you using dbt with?

The output of dbt --version:

installed version: 0.20.0
   latest version: 1.0.0

Your version of dbt is out of date! You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation

Plugins:
  - bigquery: 0.20.0
  - snowflake: 0.20.0
  - redshift: 0.20.0
  - postgres: 0.20.0

The operating system you're using: Mac OS Big Sur (11.3)

The output of python --version: Python 3.9.10

Additional context

It looks like this was fixed it here and then reverted: https://github.com/dbt-labs/dbt-external-tables/pull/120

jtcohen6 commented 2 years ago

@timbrownsf Thanks for opening the issue!

v0.8.0 of this package requires dbt-core v1.0: https://github.com/dbt-labs/dbt-external-tables/blob/4ea5203aa22ccf55222619c784de5c3b10cbeac3/dbt_project.yml#L4

(Unfortunately, you're not seeing a more helpful error because run-operation didn't previously check require-dbt-version. We fixed that in v1.0, so now it does!)

I'd encourage you to use (and pin) v0.7.3 of this package in the meantime, which is compatible with prior versions:

https://github.com/dbt-labs/dbt-external-tables/blob/3ae453cb96331f12104a5343fa9a78df07d238c7/dbt_project.yml#L6

timbrownsf commented 2 years ago

I cant see a dbt 1.0 version in homebrew, and when I use the latest version via homebrew, it doesnt seem to have that version of dbt core. I do need v.0.8.0 to get access to a change that allows snowpipe pattern filtering unfortunately

jtcohen6 commented 2 years ago

@timbrownsf Ah, sorry for the confusion on this. We changed some aspects of dbt installation in the lead-up to v1.0. In particular:

So you may need to run:

brew untap fishtown-analytics/dbt --force
brew tap dbt-labs/dbt
brew install dbt-snowflake

You can read latest docs on installation here: https://docs.getdbt.com/dbt-cli/install/overview