dbt-msft / tsql-utils

dbt-utils for the dbt-msft family of packages
MIT License
25 stars 25 forks source link

v0.19.0 #22

Closed dataders closed 3 years ago

dataders commented 3 years ago

@jtcohen6 something weird is going on with the Synapse testing... random macros are failing to compile. at first I thought that only macros unsupported by tsql-utils were the issue. the solution for this would be to add stub macro signatures so the compiler can't "fail" to find any macros.

But now I'm seeing failures for like macros like sqlserver__position. Which makes my new operating theory that when the adapter type is synapse then, the sqlserver__ macros acessible? do we need to prefix them with dbt_utils.?

Compilation Error in model test_url_path (models/web/test_url_path.sql)
  'sqlserver__position' is undefined

  > in macro position (macros/cross_db_utils/position.sql)
  > called by macro default__get_url_path (macros/web/get_url_path.sql)
  > called by macro get_url_path (macros/web/get_url_path.sql)
  > called by macro synapse__position (macros/dbt_utils/cross_db_utils/position.sql)
  > called by model test_url_path (models/web/test_url_path.sql)

UPDATE

figured it out! it's because macros needs to be fully qualified inside of a macro, even if they're from the same package, right?

jtcohen6 commented 3 years ago

figured it out! it's because macros needs to be fully qualified inside of a macro, even if they're from the same package, right?

Yes, I think you could be right here:

{% macro synapse__get_url_host(model) %}
    {% do return(tsql_utils.sqlserver__get_url_host(model)) %}
{% endmacro %} 
dataders commented 3 years ago

@jtcohen6 I'm crossing my fingers that these errors are due to the package inheritance problem that will be ironed out when there's a new release cut...

jtcohen6 commented 3 years ago

@swanderz In both CI runs, I'm seeing:

Running with dbt=0.18.1

I think this is because dbt-sqlserver commented out its dbt-core dependency (?): https://github.com/dbt-msft/dbt-sqlserver/blob/ee04bfe8cc899dbec55e9ccb210b24859b5d2bc6/setup.py#L60

Meanwhile, dbt-synapse doesn't pin its dbt-sqlserver dependency, so it installs dbt-core==0.18.1 + dbt-sqlserver==0.18.1 https://github.com/dbt-msft/dbt-synapse/blob/83a334550e4174d5ed56de4557afcb38f22b16dc/setup.py#L60

In both cases, I'd recommend pinning a dbt version (or upstream dbt adapter version):

dbt-sqlserver v0.19.0-rc1dbt-core v0.19.0-rc1 dbt-synapse v0.19.0-rc1dbt-sqlserver v0.19.0-rc1

And the same when RC2 is released: dbt-sqlserver v0.19.0-rc2dbt-core v0.19.0-rc2 dbt-synapse v0.19.0-rc2dbt-sqlserver v0.19.0-rc2