What’s New in dbt 1.9: We Read the Release Notes so you Dont Have to
Last Updated:
January 10, 2025
The latest release of dbt 1.9, introduces some exciting features and updates meant to enhance functionality and tackle some pain points of dbt. With improvements like microbatch incremental strategy, snapshot enhancements, Iceberg table format support, and streamlined CI workflows, dbt 1.9 continues to help data teams work smarter, faster, and with greater precision. All the more reason to start using dbt today!
We looked through the release notes, so you don’t have to. This article highlights the key updates in dbt 1.9, giving you the insights needed to upgrade confidently and unlock new possibilities for your data workflows. If you need a flexible dbt and Airflow experience, Datacoves might be right for your organization. Lower total cost of ownership by 50% and shortened your time to market today!
Compatibility Note: Upgrading from Older Versions
If you are upgrading from dbt 1.7 or earlier, you will need to install both dbt-core and the appropriate adapter. This requirement stems from the decoupling introduced in dbt 1.8, a change that enhances modularity and flexibility in dbt’s architecture. These updates demonstrate dbt’s commitment to providing a streamlined and adaptable experience for its users while ensuring compatibility with modern tools and workflows.
pip install dbt-core dbt-snowflake
Microbatch Incremental Strategy: A Better Way to Handle Large Data
In dbt 1.9, the microbatch incremental strategy is a new way to process massive datasets. In earlier versions of dbt, incremental materialization was available to process datasets which were too large to drop and recreate at every build. However, it struggled to efficiently manage very large datasets that are too large to fit into one query. This limitation led to timeouts and complex query management.
The microbatch incremental strategy comes to the rescue by breaking large datasets into smaller chunks for processing using the batch_size
, event_time
, and lookback
configurations to automatically generate the necessary filters for you. However, at the time of this publication this feature is only available on the following adapters: Postgres, Redshift, Snowflake, BigQuery, Spark, and Databricks, with more on the way.
Key Benefits of Microbatching
- Simplified Query Design: As mentioned earlier, dbt will handle the logic for your batch data using simple, yet powerful configurations. By setting the
event_time
,lookback
, andbatch_size
configurations dbt will generate the necessary filters for each batch. One less thing to worry about!
- Independent Batch Processing: dbt automatically splits your data into smaller chunks based on the
batch_size
you set. Each batch is processed separately and in parallel, unless you disable this feature using the+concurrent_batches
config. This independence in batch processing improves performance, minimizes the risk of query failures, allows you to retry failed batches using thedbt retry
command, and provides the granularity to load specific batches. Gotta love the control without the extra leg work!
Compatibility Note: Custom microbatch macros
To take advantage of the microbatch incremental strategy, first upgrade to dbt 1.9 and ensure your project is configured correctly. By default, dbt will handle the microbatch logic for you, as explained above. However, if you’re using custom logic, such as a custom microbatch macro, don’t forget to set the require_batched_execution_for_custom_microbatch_strategy
behavior flag to True in your dbt_project.yml file. This prevents deprecation warnings and ensures dbt knows how to handle your custom configuration.
If you have custom microbatch but wish to migrate, its important to note that earlier versions required setting the environment variable DBT_EXPERIMENTAL_MICROBATCH
to enable microbatching, but this is no longer needed. Starting with Core 1.9, the microbatch strategy works seamlessly out of the box, so you can remove it.
Enhanced Snapshots: Smarter and More Flexible Data Tracking
With dbt 1.9, snapshots have become easier to use than ever! This is great news for dbt users since snapshots in dbt allow you to capture the state of your data at specific points in time, helping you track historical changes and maintain a clear picture of how your data evolves. Below are a couple of improvements to implement or be aware of.
Key Improvements in Snapshots
- YAML Configurations: Snapshots can now be defined directly in YAML files. This makes them easier to manage, read, and update, allowing for a more streamlined configuration process that aligns with other dbt project components. Lots of things are easier in YAML. 😉
- Customizable Metadata Fields: With the
snapshot_meta_column_names
config you now have the option to rename metadata fields to match your project's naming conventions. This added flexibility helps ensure consistency across your data models and simplifies collaboration within teams.
- Default target_schema: If you do not specify a schema for your snapshots, dbt will use the schema defined for the current environment. This means that snapshots will be created in the default schema associated with your dbt environment settings.
- Standardization of resource type: Snapshots now support the standard schema and database configurations, similar to models and seeds. This standardization allows you to define where your snapshots are stored using familiar configuration patterns.
- New Warnings: You will now get a warning if you set an incorrect updated_at data type. This ensures it is an accepted data type or timestamp. No more silent error.
- Set an expiration date: Before dbt 1.9 the
dbt_valid_to
variable is set toNULL
but you can now you can configure it to a data with thedbt_valid_to_current
config. It is important to note that dbt will not automatically adjust the current value in the existingdbt_valid_to
column. Meaning, any existing current records will still havedbt_valid_to
set toNULL
and new records will have this value set to your configured date. You will have to manually update existing data to match. LessNULL
values to handle downstream!
- dbt snapshot–empty: In dbt 1.9, the
--empty
flag is now supported for the dbt snapshot command, allowing you to execute snapshot operations without processing data. This enhancement is particularly useful in Continuous Integration (CI) environments, enabling the execution of unit tests for models downstream of snapshots without requiring actual data processing, streamlining the testing process. The empty flag, introduced in dbt 1.8, also has some powerful applications in Slim CI to optimize your CI/CD worth checking out.
- Improved Handling of Deleted Records: In dbt version 1.9, the
hard_deletes
configuration enhances the management of deleted records in snapshots. This feature offers three methods: the defaultignore
, which takes no action on deleted records;invalidate
, replacing theinvalidate_hard_deletes=true
config, which marks deleted records as invalid by setting theirdbt_valid_to
timestamp to the current time; and lastlynew_record
, which tracks deletions by inserting a new record with adbt_is_deleted
config set to True.
Compatibility Note: hard_deletes
It's important to note some migration efforts will be required for this. While the invalidate_hard_deletes
configuration is still supported for existing snapshots, it cannot be used alongside hard_deletes
. For new snapshots, it's recommended to use hard_deletes
instead of the legacy invalidate_hard_deletes
. If you switch an existing snapshot to use hard_deletes
without migrating your data, you may encounter inconsistent or incorrect results, such as a mix of old and new data formats. Keep this in mind when implementing these new configs.
Unit Testing Enhancements: Streamlined Testing for Better Data Quality
Testing is a vital part of maintaining high data quality and ensuring your data models work as intended. Unit testing was introduced in dbt 1.8 and has seen continued improvement in dbt 1.9.
Key Enhancements in Unit Testing:
- Selective Testing with Unit Test Selectors: dbt 1.9 introduces a new selection method for unit tests, allowing users to target specific unit tests directly using the
unit_test:
selector. This feature enables more granular control over test execution, allowing you to focus on particular tests without running the entire suite, thereby saving time and resources.
dbt test --select unit_test:my_project.my_unit_test
dbt build --select unit_test:my_project.my_unit_test
- Improved Resource Type Handling: The update ensures that commands like
dbt list --resource-type test
now correctly include only data tests, excluding unit tests. This distinction enhances clarity and precision when managing different test types within your project.
dbt ls --select unit_test:my_project.my_unit_test
Slim CI State Modifications: Smarter and More Accurate Workflows
In dbt version 1.9, the state:modified
selector has been enhanced to improve the accuracy of Slim CI workflows. Previously, dynamic configurations—such as setting the database based on the environment—could lead to dbt perceiving changes in models, even when the actual model remained unchanged. This misinterpretation caused Slim CI to rebuild all models unnecessarily, resulting in false positives.
By comparing unrendered configuration values, dbt now accurately detects genuine modifications, eliminating false positives during state comparisons. This improvement ensures that only truly modified models are selected for rebuilding, streamlining your CI processes.
Key Benefits:
- Improved Accuracy: Focusing on unrendered configurations reduces false positives during state comparisons.
- Streamlined CI Processes: Enhanced change detection allows CI workflows to concentrate solely on resources that require updates or testing.
- Time and Resource Efficiency: Minimizing unnecessary computations conserves both time and computational resources.
To enable this feature,
set the state_modified_compare_more_unrendered_values flag
to True in your dbt_project.yml file:
flags:
state_modified_compare_more_unrendered_values: True
Enhanced Documentation Hosting with --host Flag in dbt 1.9
In dbt 1.9, the dbt docs serve command now has more customization abilities with a new --host
flag. This flag allows users to specify the host address for serving documentation. Previously, dbt docs serve defaulted to binding the server to 127.0.0.1 (localhost)
without an option to override this setting.
Users can now specify a custom host address using the --host
flag when running dbt docs serve. This enhancement provides the flexibility to bind the documentation server to any desired address, accommodating various deployment needs. The default of the --host
flag will continue to bind to 127.0.0.1
by default, ensuring backward compatibility and secure defaults.
Key Benefits:
- Deployment Flexibility: Users can bind the documentation server to different host addresses as required by their deployment environment.
- Improved Accessibility: Facilitates access to dbt documentation across various network configurations by enabling custom host bindings.
- Enhanced Compatibility: Addresses previous limitations and resolves issues encountered in deployments that require non-default host bindings.
Other Notable Improvements in dbt 1.9
dbt 1.9 includes several updates aimed at improving performance, usability, and compatibility across projects. These changes ensure a smoother experience for users while keeping dbt aligned with modern standards.
- Iceburg table support: With dbt 1.9, you can now add Iceberg table support to table, incremental, dynamic table materializations.
- Optimized dbt clone Performance: The
dbt clone
command now executes clone operations concurrently, enhancing efficiency and reducing execution time.
- Parseable JSON and Text Output in Quiet Mode: The
dbt show
anddbt compile
commands now support parseable JSON and text outputs when run in quiet mode, facilitating easier integration with other tools and scripts by providing machine-readable outputs.
skip_nodes_if_on_run_start_fails
Behavior Change Flag: A new behavior change flag,skip_nodes_if_on_run_start_fails
, has been introduced to gracefully handle failures in on-run-start hooks. When enabled, if an on-run-start hook fails, subsequent hooks and nodes are skipped, preventing partial or inconsistent runs.
Compatibility Note: Sans Python 3.8
- Python 3.8 Support Removed: dbt 1.9 no longer supports Python 3.8, encouraging users to upgrade to newer Python versions. This ensures compatibility with the latest features and enhances overall performance.
Conclusion
dbt 1.9 introduces a range of powerful features and enhancements, reaffirming its role as a cornerstone tool for modern data transformations. The enhancements in this release reflect the community's commitment to innovation and excellence as well as its strength and vitality. There's no better time to join this dynamic ecosystem and elevate your data workflows!
If you're looking to implement dbt efficiently, consider partnering with Datacoves. We can help you reduce your total cost of ownership by 50% and accelerate your time to market. Book a call with us today to discover how we can help your organization in building a modern data stack with minimal technical debt.
Checkout the full release notes.