dbt-core v1.0.0
dbt Core 1.0.0 - W. E. B. Du Bois (December 3, 2021)
Breaking changes
- The two type of test definitions are now "singular" and "generic" (instead of "data" and "schema", respectively). The
test_type:
selection method acceptstest_type:singular
andtest_type:generic
. (It will also accepttest_type:schema
andtest_type:data
for backwards compatibility) (#3234, #3880). Not backwards compatible: The--data
and--schema
flags todbt test
are no longer supported, and tests no longer have the tags'data'
and'schema'
automatically applied. - Deprecated the use of the
packages
argadapter.dispatch
in favor of themacro_namespace
arg. (#3895) - Enable
on-run-start
andon-run-end
hooks fordbt test
. Addflags.WHICH
to execution context, representing current task (#3463, #4004) - Replace
greedy
flag/property for test selection withindirect_selection: eager/cautious
flag/property. Set toeager
by default. Note: This reverts test selection to its pre-v0.20 behavior by default.dbt test -s my_model
will select multi-parent tests, such asrelationships
, that depend on unselected resources. To achieve the behavior change in v0.20 + v0.21, set--indirect-selection=cautious
on the CLI orindirect_selection: cautious
in yaml selectors. (#4082, #4104) - In v1.0.0,
pip install dbt
will raise an explicit error. Instead, please usepip install dbt-<adapter>
(to use dbt with that database adapter), orpip install dbt-core
(for core functionality). For parity with the previous behavior ofpip install dbt
, you can use:pip install dbt-core dbt-postgres dbt-redshift dbt-snowflake dbt-bigquery
(#4100, #4133) - Reorganize the
global_project
(macros) into smaller files with clearer names. Remove unused global macros:column_list
,column_list_for_create_table
,incremental_upsert
(#4154) - Introduce structured event interface, and begin conversion of all legacy logging (#3359, #4055)
- This is a breaking change for adapter plugins, requiring a very simple migration. See
events
module README for details. - If you maintain another kind of dbt-core plugin that makes heavy use of legacy logging, and you need time to cut over to the new event interface, you can re-enable the legacy logger via an environment variable shim,
DBT_ENABLE_LEGACY_LOGGER=True
. Be advised that we will remove this capability in a future version of dbt-core.
- This is a breaking change for adapter plugins, requiring a very simple migration. See
- Restrict secret env vars (prefixed
DBT_ENV_SECRET_
) toprofiles.yml
+packages.yml
only. Raise an exception if a secret env var is used elsewhere (#4310, #4311) - Reorder arguments to
config.get()
so thatdefault
is second (#4273, #4297)
Features
- Normalize global CLI arguments/flags (#2990, #3839)
- Turns on the static parser by default and adds the flag
--no-static-parser
to disable it. (#3377, #3939) - Generic test FQNs have changed to include the relative path, resource, and column (if applicable) where they are defined. This makes it easier to configure them from the
tests
block indbt_project.yml
(#3259, #3880 - Turn on partial parsing by default (#3867, #3989)
- Generic test can now be added under a
generic
subfolder in thetest-paths
directory. (#4052) - Add
result:<status>
selectors to automatically rerun failed tests and erroneous models. This makes it easier to rerun failed dbt jobs with a simple selector flag instead of restarting from the beginning or manually running the dbt models in scope. (#3859, #4017) dbt init
is now interactive, generating profiles.yml when run inside existing project (#3625)- Avoid error when missing column in YAML description (#4151, #4285)
- Allow
--defer
flag todbt snapshot
(#4110, #4296) - Install prerelease packages when
version
explicitly references a prerelease version, regardless ofinstall-prerelease
status (#4243, #4295) - Add data attributes to json log messages (#4301)
- Add event codes to all log events (#4319)
- Allow nullable
error_after
in source freshness (#3874, #3955) - Add
metrics
nodes (#4071, #4235) - Add support for
dbt init <project_name>
, and support forskip_profile_setup
argument (dbt init -s
) (#4156, #4249)
Fixes
- Add generic tests defined on sources to the manifest once, not twice (#3347, #3880)
- Skip partial parsing if certain macros have changed (#3810, #3982)
- Enable cataloging of unlogged Postgres tables (3961, #3993)
- Fix multiple disabled nodes (#4013, #4018)
- Fix multiple partial parsing errors (#3996, #4020)
- Return an error instead of a warning when runing with
--warn-error
and no models are selected (#4006, #4019) - Fixed bug with
error_if
test option (#4070) - Allow retries when the answer from a
dbt deps
isNone
(#4178, #4225) - Allow specifying default in Jinja config.get with default keyword (#4273, #4297)
- Fix serialization error with missing quotes in metrics model ref (#4252, #4287)
- Correct definition of 'created_at' in ParsedMetric nodes (#4298, #4299)
- Fix serialization error with missing quotes in metrics model ref (#4252, #4287)
- Correct definition of 'created_at' in ParsedMetric nodes (#4298, #4299)
- Support partial parsing of env_vars in metrics (#4253, #4322)
- Fix typo in
UnparsedSourceDefinition.__post_serialize__
(#3545, #4349) - Configure the CLI logger destination to use stdout instead of stderr (#4368)
- Make the size of
EVENT_HISTORY
configurable, viaEVENT_BUFFER_SIZE
global config (#4411, #4416) - Change type of
log_format
inprofiles.yml
user config to be string, not boolean (#4394)
Docs
- Fix non-alphabetical sort of Source Tables in source overview page (docs#81, docs#218)
- Add title tag to node elements in tree (docs#202, docs#203)
- Account for test rename:
schema
→generic
,data
→singular
. Usetest_metadata
instead ofschema
/data
tags to differentiate (docs#216, docs#222) - Add
metrics
(core#216, docs#223)
Under the hood
- Enact deprecation for
materialization-return
and replace deprecation warning with an exception. (#3896) - Build catalog for only relational, non-ephemeral nodes in the graph (#3920)
- Enact deprecation to remove the
release
arg from theexecute_macro
method. (#3900) - Enact deprecation for default quoting to be True. Override for the
dbt-snowflake
adapter so it staysFalse
. (#3898) - Enact deprecation for object used as dictionaries when they should be dataclasses. Replace deprecation warning with an exception for the dunder methods of
__iter__
and__len__
for all superclasses of FakeAPIObject. (#3897) - Enact deprecation for
adapter-macro
and replace deprecation warning with an exception. (#3901) - Add warning when trying to put a node under the wrong key. ie. A seed under models in a
schema.yml
file. (#3899) - Plugins for
redshift
,snowflake
, andbigquery
have moved to separate repos:dbt-redshift
,dbt-snowflake
,dbt-bigquery
- Change the default dbt packages installation directory to
dbt_packages
fromdbt_modules
. Also renamemodule-path
topackages-install-path
to allow default overrides of package install directory. Deprecation warning added for projects using the olddbt_modules
name without specifying apackages-install-path
. (#3523) - Update the default project paths to be
analysis-paths = ['analyses']
andtest-paths = ['tests]
. Also have starter project setanalysis-paths: ['analyses']
from now on. (#2659) - Define the data type of
sources
as an array of arrays of string in the manifest artifacts. (#3966, #3967) - Marked
source-paths
anddata-paths
as deprecated keys indbt_project.yml
in favor ofmodel-paths
andseed-paths
respectively.(#1607) - Surface git errors to
stdout
when cloning dbt packages from Github. (#3167) - Fix intermittent errors in partial parsing tests (#4060, #4068)
- Make finding disabled nodes more consistent (#4069, #4073)
- Remove connection from
render_with_context
during parsing, thereby removing misleading log message (#3137, #4062) - Wait for postgres docker container to be ready in
setup_db.sh
. (#3876, #3908) - Prefer macros defined in the project over the ones in a package by default (#4106, #4114)
- Dependency updates (#4079), (#3532
- Schedule partial parsing for SQL files with env_var changes (#3885, #4101)
- Schedule partial parsing for schema files with env_var changes (#3885, #4162)
- Skip partial parsing when env_vars change in dbt_project or profile (#3885, #4212)
- Bump artifact schema versions for 1.0.0: manifest v4, run results v4, sources v3. Notable changes: added
metrics
nodes; schema test + data test nodes are renamed to generic test + singular test nodes; freshness threshold default values (#4191) - Speed up node selection by skipping
incorporate_indirect_nodes
if not needed (#4213, #4214) - When
on_schema_change
is set, pass common columns asdest_columns
in incremental merge macros (#4144, #4170) - Clear adapters before registering in
lib
module config generation (#4218) - Remove official support for python 3.6, which is reaching end of life on December 23, 2021 (#4134, #4223)
- Changes unit tests using
assertRaisesRegexp
toassertRaisesRegex
(#4136, #4136) - Add --indirect-selection parameter to profiles.yml and builtin DBT_ env vars; stringified parameter to enable multi-modal use (#3997, #4270)
- Fix filesystem searcher test failure on Python 3.9 (#3689, #4271)
- Clean up deprecation warnings shown for
dbt_project.yml
config renames (#4276, #4291) - Fix metrics count in compiled project stats (#4290, #4292)
- First pass at supporting more dbt tasks via python lib (#4200)
- Change some CompilationExceptions to ParsingExceptions (#4254, #4328)
- Reorder logic for static parser sampling to speed up model parsing (#4332)
- Use more augmented assignment statements (#4315), (#4311)
- Adjust logic when finding approximate matches for models and tests (#3835), #4076)
- Restore small previous behaviors for logging: JSON formatting for first few events;
WARN
-level stdout forlist
task; include tracking events indbt.log
(#4341) - Only log cache events if
LOG_CACHE_EVENTS
is enabled, and disable by default. This restores previous behavior (#4369) - Move event codes to be a top-level attribute of JSON-formatted logs, rather than nested in
data
(#4381) - Fix failing integration test on Windows (#4380)
- Clean up warning messages for
clean
+deps
(#4366) - Use RFC3339 timestamps for log messages (#4384)
- Different text output for console (info) and file (debug) logs (#4379, #4418)
- Remove unused events. More structured
ConcurrencyLine
. Replace\n
message starts/ends withEmptyLine
events, and excludeEmptyLine
from JSON-formatted output (#4388) - Update
events
module README (#4395) - Rework approach to JSON serialization for events with non-standard properties (#4396)
- Update legacy logger file name to
dbt.log.legacy
(#4402) - Rollover
dbt.log
at 10 MB, and keep up to 5 backups, restoring previous behavior (#4405) - Use reference keys instead of full relation objects in cache events (#4410)
- Add
node_type
contextual info to more events (#4378) - Make
materialized
config optional innode_type
(#4417) - Stringify exception in
GenericExceptionOnRun
to support JSON serialization (#4424) - Add "interop" tests for machine consumption of structured log output (#4327)
- Relax version specifier for
dbt-extractor
to~=0.4.0
, to support compiled wheels for additional architectures when available (#4427)
Contributors
- @b-per (#4225)
- @dave-connors-3 (#3920)
- @emilieschario (#4076)
- @frankcash (#4136)
- @gitznik (#4124)
- @JCZuurmond (#4114)
- @joellabes (#4104, #4295)
- @kadero (#3952, #3955, #4249, #4285, #4296)
- @Kayrnt (#4136)
- @laxjesse (#4019)
- @ljhopkins2 (#4079)
- @matt-winkler (#4017)
- @miike (docs#203)
- @NiallRees (#3625)
- @rvacaru (#3908)
- @salmonsd (docs#218)
- @samlader (#3993)
- @sarah-weatherbee (#4331)
- @sneznaj (#4349)
- @sungchun12 (#4017)
- @VersusFacit (#4104)
- @yu-iskw (#3967)
W. E. B. Du Bois (1868–1963)
A famous Philadelphian, and the namesake of this dbt Core release
William Edward Burghardt Du Bois was born three years after the U.S. Civil War ended, and he died one day before the March on Washington for Jobs and Freedom. During the 95 intervening years, he studied, wrote, theorized, and agitated for racial equality in the United States.
He was a leader of the Niagara Movement and co-founder of the NAACP. His was the first definitive study of Reconstruction, a critical (and critically misunderstood) period of American history; he laid intellectual groundwork for civil rights movements in the United States, and independence movements around the world.
Du Bois lived in Philadelphia for one crucial year, 1897, during which he completed the first serious sociological study of any Black community anywhere in the United States. This was The Philadelphia Negro, which took aim at the monolithic stereotypes of inner-city Black America. In their place, Du Bois returned a nuanced, complicated portrait of a diverse and struggling community that was rooted in archival research, descriptive statistics, and questionnaires from over 5,000 interviews, which he personally conduced with the help of Isabel Eaton. It was a foundational work for the field of sociology, not least for its reliance on in survey data and statistical methods.
Three years after he left Philadelphia, and three years before he would publish his most famous work, The Souls of Black Folk, Du Bois was a principal contributor to an unprecedented exhibit for the 1900 Paris Exposition. For a display on Black America at the turn of the century, Du Bois curated 500 photographs, plus five dozen data visualizations (!), hand-drawn in full colour by teams of current and former students at HBCUs. Drawing data from the Census, the Bureau of Labor, and their own research, these charts, graphs, and maps told a story of incredible social and economic progress for Black Americans since Emancipation, yet at the same time quantifying the continued legacy of slavery and the failures of Reconstruction. These visualizations were seen by millions of world’s fair attendees in 1900; stored in the Library of Congress for a century; and finally made visible again, thanks to their publication in W. E. B. Du Bois’s Data Portraits: Visualizing Black America (ed. Whitney Battle Baptiste and Britt Rusert, Princeton Architectural Press, 2018).
Du Bois lived a long life, over the course of which he never stopped studying, changing his mind, reexamining his commitments, making uneasy alliances, falling in and out of favour with powerful people. He was a pragmatist, always listening to the data, always refining his theories of change, always staying true to a core vision of equality, justice, and peace.
The return from your work must be the satisfaction which that work brings you and the world’s need of that work. With this, life is heaven, or as near heaven as you can get. - The Autobiography of W. E. B. Du Bois (1968)