Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize not running in python models after the first run #913

Open
talperetz1 opened this issue Jan 26, 2025 · 2 comments
Open

Optimize not running in python models after the first run #913

talperetz1 opened this issue Jan 26, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@talperetz1
Copy link

talperetz1 commented Jan 26, 2025

Describe the bug

When running dbt python model with workflow_job no optimize run after the operation

Steps To Reproduce

Run a python model with liquid cluster by

Expected behavior

Expected to see the following operations: merge, cluster by, optimiz

System information

The output of dbt --version:

Core:
  - installed: 1.9.1
  - latest:    1.9.1

Plugins:
  - databricks: 1.9.1 
  - spark:      1.9.0 

The operating system you're using:
linux

The output of python --version:
Python 3.11.2

Additional context

Issue Description:
I have many SQL models that utilize liquid_cluster_by. The behavior for these models includes merge, cluster by, and optimize operations.

However, when I run Python models, I noticed the following behavior:

On the first run (when creating the table), the optimize operation is executed.
On subsequent runs, only the merge operation is performed.
If liquid_cluster_by is present, the merge operation is followed by cluster by, which is pointless without optimize.
Additionally, I observed that the optimize operation does not execute for Python models, regardless of whether liquid_cluster_by is specified.

def model(dbt, session):

    dbt.config(submission_method='workflow_job')
    dbt.config(materialized='incremental')
    dbt.config(file_format='delta')
    dbt.config(unique_key=['x'])
    dbt.config(liquid_clustered_by=['x'])
    dbt.config(incremental_strategy='merge')
    dbt.config(on_schema_change='append_new_columns')
    dbt.config(location_root='s3://......')

Thanks,

Image
@talperetz1 talperetz1 added the bug Something isn't working label Jan 26, 2025
@benc-db
Copy link
Collaborator

benc-db commented Jan 27, 2025

Thanks for reporting

@talperetz1
Copy link
Author

@benc-db Thank you for your answer. I edited the bug info and added the dbt.config so it is clear that I am talking about workflow_job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants