You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Executing dbt run --empty on a model with stage macro with a source relation as source_model fails. Model runs successfully if --empty is not invocated.
# sqlserver_relation.pydefrender_limited(self) ->str:
rendered=self.render()
ifself.limitisNone:
returnrenderedelifself.limit==0:
returnf"(select * from {rendered} where 1=0) {self._render_limited_alias()}"else:
returnf"(select TOP {self.limit} * from {rendered}) {self._render_limited_alias()}"
Describe the bug
Executing
dbt run --empty
on a model with stage macro with a source relation as source_model fails. Model runs successfully if--empty
is not invocated.Environment
dbt version: 1.8.6
automate_dv version: 0.11.0
Database/Platform: sqlserver 1.8.4
Expected behavior
The model to run.
Additional context
Issue seems to be related to
in https://github.com/dbt-msft/dbt-sqlserver/blob/ec30afe13b3bd487535f5342ef3be79d06c63edc/dbt/adapters/sqlserver/sqlserver_relation.py#L33
effectively replacing
source()
to return a sub-query instead of the expected relation object and breaking subsequent logicsuggested change
AB#5620
The text was updated successfully, but these errors were encountered: