Deprecations
Deprecations (폐기 예정 기능)
Deprecations은 프로젝트 코드(모델, 설정, 구문)에서 미래 버전에 동작이 중단될 기능들을 말해요. deprecated된 기능은 아직 동작하지만 곧 사라질 예정이니 미리 파악하고 처리해두는 게 좋아요.
출처: 문서
본문
참고 — deprecated 기능은 v1.10 릴리스에서 여전히 동작하지만 더 이상 지원되지 않고 미래 버전에서 제거될 거예요. Deprecations는 현재 경고로 표시되며 (warnings as errors를 구성하지 않는 한) 실행이나 다른 명령을 막지 않지만, 처리하지 않으면 업그레이드 후 에러가 될 거예요.
이것은 behavior change flags(dbt_project.yml 파일의 옵트인/아웃 플래그)나 deprecated CLI flags(dbt v2에서 제거되는 커맨드라인 플래그)와는 달라요. 빠른 비교는 Changes overview를 참고해요.
dbt v2로 업그레이드하시나요? 업그레이드 전에 이 페이지에 나열된 모든 deprecations을 해결해야 해요.
dbt가 실행되면서 여러 범주의 events를 생성하는데, 그 중 하나가 deprecations이에요. Deprecations은 미래 dbt 버전에서 breaking change를 초래할 프로젝트 부분에 문제가 있음을 알려주는 특별한 유형의 경고예요. 지금은 경고일 뿐이지만, 앞으로 더 안전하고 피드백이 풍부하며 자신 있게 작업하려면 프로젝트의 deprecation 경고를 해결하는 것이 중요해요.
Deprecation 경고 식별하기
표준 로그만 봐서 내 코드에 영향을 주는 deprecations을 찾는 건 어려운 일일 수 있어요. 이를 찾는 게 해결의 첫 단계예요. deprecations을 빠르게 찾고 일부는 자동으로 해결하는 여러 방법이 있어요.
dbt CLI
CLI에서 deprecations을 보려면 다음을 실행해요:
dbt parse --no-partial-parse --show-all-deprecations
--no-partial-parse 플래그는 파싱 중에만 발견되는 deprecations도 포함되도록 보장해요. --show-all-deprecations 플래그는 deprecation이 처음 것 하나만이 아니라 각 발생을 모두 나열하도록 보장해요.
(앱: dbt v2.0 이상)
dbt v2와
dbt parse— dbt v2를 쓸 때는 위 명령에서--no-partial-parse를 빼야 해요. 그 플래그는 dbt v2에서 deprecated이며dbt1700deprecation 경고를 로그로 남길 수 있어요.dbt parse --show-all-deprecations를--no-partial-parse없이 실행해요. 자세한 내용은 dbt v2 업그레이드 가이드의 Deprecated flags를 참고해요.
19:15:13 [WARNING]: Deprecated functionality
Summary of encountered deprecations:
- MFTimespineWithoutYamlConfigurationDeprecation: 1 occurrence
dbt platform
dbt를 사용한다면 계정의 Dashboard 영역에서 deprecation 경고를 볼 수 있어요.
dbt 대시보드에 나열된 deprecation 경고.
job을 클릭해 더 자세한 내용을 보고 로그에서 deprecation 경고를 찾아요(또는 Studio IDE나 dbt platform CLI에서 플래그와 함께 parse 명령을 실행해요).
로그에 나열된 deprecation 경고.
자동 해결
일부 deprecations은 스크립트로 자동 수정할 수 있어요. 이 dbt 블로그 글에서 자세히 읽어보세요. 스크립트를 다운로드해 설치 지침을 따라 시작할 수 있어요.
이 스크립트를 Studio IDE에서 Autofix warnings 버튼으로 직접 실행해 dbt platform의 deprecation 경고를 해결할 수 있어요.
Studio IDE의 Autofix warnings 버튼으로 dbt platform의 deprecation 경고를 해결해요.
Deprecation 경고 숨기기
dbt Labs는 deprecation 경고를 숨기기보다 고치기를 권장해요. 로그의 소음을 일시적으로 줄이려면 silence 파라미터와 함께 --warn-error-options를 사용해요. 이건 dbt test와 dbt parse를 포함한 어떤 dbt 명령어에서도 동작해요.
전체 구성 옵션(CLI 플래그, 환경 변수, dbt_project.yml)은 Warnings를 참고해요.
dbt v1에서 모든 deprecation 경고를 숨기려면:
dbt test --warn-error-options '{"silence": ["Deprecations"]}'
(앱: dbt v2.0 이상)
dbt v2에서는 동작이 dbt v1과 달라요:
Deprecations그룹이 모든 deprecation 스타일 경고를 숨기지 않을 수도 있어요. 로그의 특정 이벤트 이름(예:SemanticModelDeprecated)을 선호해요.- 일부 deprecated config는 dbt v2에서 하드 에러(hard error)라 숨길 수 없어요. 반드시 고쳐야 해요.
dbt v2가 warn_error_options를 어떻게 처리하는지, 지원되는 이름, 하드 에러 사례에 대한 자세한 내용은 dbt v2 동작과 경고 코드를 참고해요.
Deprecation 경고 목록
다음은 현재 dbt의 deprecation 경고와 그 경고가 처음 나타난 연관 버전 번호예요.
ArgumentsPropertyInGenericTestDeprecation
dbt는 제네릭 테스트에 arguments라는 커스텀 최상위 속성을 지정하는 기능을 deprecated했어요. 이 deprecation 경고는 require_generic_test_arguments_property 동작 플래그가 false로 설정된 경우에만 발생해요.
ArgumentsPropertyInGenericTestDeprecation 해결
예를 들어 이전에 커스텀 제네릭 테스트에 arguments 속성이 있었다면:
model.yml
models:
- name: my_model_with_generic_test
data_tests:
- my_custom_generic_test:
arguments: [1,2,3]
expression: "order_items_subtotal = subtotal"
require_generic_test_arguments_property 플래그를 true로 설정하고 테스트에 대한 키워드 인자를 새 arguments 속성 아래 중첩해야 해요:
model.yml
models:
- name: my_model_with_generic_test
data_tests:
- my_custom_generic_test:
arguments:
arguments: [1,2,3]
expression: "order_items_subtotal = subtotal"
대안으로, 원래 arguments 키워드를 dbt 프레임워크의 새 arguments 키와 충돌하지 않는 다른 이름으로 바꿀 수 있어요. 이 이름 변경은 테스트 매크로 정의에서도 일어나야 하고, 바꾼 키는 구문상 유효하려면 여전히 arguments 속성 안에 지정해야 해요. 예를 들어:
model.yml
models:
- name: my_model_with_generic_test
data_tests:
- my_custom_generic_test:
arguments:
renamed_arguments: [1,2,3]
expression: "order_items_subtotal = subtotal"
ConfigDataPathDeprecation
dbt v1.0에서 data-paths가 seed-paths로 이름이 바뀌었어요. 이 deprecation 경고를 받으면 프로젝트의 dbt_project.yml에 여전히 data-paths가 사용되고 있다는 뜻이에요.
예시 경고:
CLI
23:14:58 [WARNING]: Deprecated functionality
The `data-paths` config has been renamed to `seed-paths`. Please update your
`dbt_project.yml` configuration to reflect this change.
ConfigDataPathDeprecation 해결
dbt_project.yml에서 data-paths를 seed-paths로 바꿔요.
ConfigLogPathDeprecation
dbt v1.5에서 dbt_project.yml에 log-path를 지정하는 게 deprecated됐어요. 이 deprecation 경고를 받는다는 건 dbt_project.yml에 여전히 log-path가 지정되어 있고 기본값 logs로 설정되지 않았다는 뜻이에요.
예시:
CLI
(앱: dbt v1.11 이상)
23:39:18 [WARNING]: Deprecated functionality
The `log-path` config in `dbt_project.yml` has been deprecated and will no
longer be supported in a future version of dbt-core. If you wish to write dbt
logs to a custom directory, please use the --log-path CLI flag or DBT_ENGINE_LOG_PATH
env var instead.
ConfigLogPathDeprecation 해결
dbt_project.yml에서 log-path를 제거하고 CLI 플래그 --log-path나 환경 변수(앱: dbt v1.11 이상) DBT_ENGINE_LOG_PATH로 지정해요 여기 문서처럼.
ConfigSourcePathDeprecation
dbt v1.0에서 source-paths가 model-paths로 이름이 바뀌었어요. 이 deprecation 경고를 받으면 프로젝트의 dbt_project.yml에 여전히 source-paths가 사용되고 있다는 뜻이에요.
예시:
CLI
23:03:47 [WARNING]: Deprecated functionality
The `source-paths` config has been renamed to `model-paths`. Please update your
`dbt_project.yml` configuration to reflect this change.
23:03:47 Registered adapter: postgres=1.9.0
ConfigSourcePathDeprecation 해결
dbt_project.yml에서 source-paths를 model-paths로 바꿔요.
ConfigTargetPathDeprecation
dbt 1.5에서 dbt_project.yml에 target-path를 지정하는 게 deprecated됐어요. 이 deprecation 경고를 받는다는 건 dbt_project.yml에 여전히 target-path가 지정되어 있고 기본값 target으로 설정되지 않았다는 뜻이에요.
예시:
CLI
(앱: dbt v1.11 이상)
23:22:01 [WARNING]: Deprecated functionality
The `target-path` config in `dbt_project.yml` has been deprecated and will no
longer be supported in a future version of dbt-core. If you wish to write dbt
artifacts to a custom directory, please use the --target-path CLI flag or
DBT_ENGINE_TARGET_PATH env var instead.
ConfigTargetPathDeprecation 해결
dbt_project.yml에서 target-path를 제거하고 CLI 플래그 --target-path나 환경 변수(앱: dbt v1.11 이상) DBT_ENGINE_TARGET_PATH로 지정해요.
CustomKeyInConfigDeprecation
이 경고는 공식 config 스펙의 일부로 dbt가 인식하지 못하는 커스텀 config 키를 사용할 때 발생해요. SQL과 YAML 파일 양쪽의 config 블록에 적용돼요.
경고를 유발하는 예시:
models:
- name: my_model
config:
custom_config_key: value
CustomKeyInConfigDeprecation 해결
커스텀 키를 meta 아래 중첩하고 meta가 config 아래 중첩되게 해요(PropertyMovedToConfigDeprecation와 유사). 예를 들어:
models:
- name: my_model
config:
meta:
custom_config_key: value
CustomKeyInObjectDeprecation
이 경고는 dbt가 공식 config 스펙의 일부로 인식하지 못하는 config를 지정할 때 표시돼요. 이는 커스텀 config이거나 columns 리스트에서 meta를 최상위 키로 정의하는 경우일 수 있어요.
이전에는 config 아래에 추가 필드를 직접 정의할 수 있어서, 기존 사용자 정의 config와 dbt 프레임워크의 공식 config 사이에 충돌이 생길 수 있었어요.
dbt v1.10과 dbt v2부터 최상위 config 키는 dbt 프레임워크의 공식 구성용으로 예약될 거예요.
이 deprecation 경고는 다음 어댑터에서만 발생해요:
- Snowflake
- Databricks
- BigQuery
- Redshift
CustomKeyInObjectDeprecation 해결
커스텀 config를 meta 아래 중첩하고 meta가 config 아래 중첩되게 해요(PropertyMovedToConfigDeprecation와 유사).
커스텀 키가 모델 config에 있든 제네릭 테스트 정의에 있든 해결 방법은 같아요. 예시를 보려면 관련 탭을 선택해요:
모델 config
경고를 유발하는 예시:
models:
- name: my_model
config:
custom_config_key: value
columns:
- name: my_column
meta:
some_key: some_value
해결 예시:
models:
- name: my_model
config:
meta:
custom_config_key: value
columns:
- name: my_column
config:
meta:
some_key: some_value
제네릭 테스트 정의
tests: 블록의 테스트 아래에 커스텀 키를 직접 정의한다면, config.meta 아래 중첩해요.
경고를 유발하는 예시:
tests:
- name: custom_generic_test
description: My custom generic test
arguments:
- name: active_timestamp
type: timestamp
description: The active timestamp for the model
해결 예시:
tests:
- name: custom_generic_test
description: My custom generic test
config:
meta:
arguments:
- name: active_timestamp
type: timestamp
description: The active timestamp for the model
중첩된 구성에 접근하기
meta의 속성 아래 중첩된 커스텀 구성을 접근하려면 config.get('meta')를 사용한 다음 커스텀 속성 이름으로 meta 사전을 인덱싱해요. 커스텀 config 키를 직접 최상위 키로 접근하던 코드를 조정해야 해요.
커스텀 구성이 meta 아래 중첩되기 전의 예시:
{% set my_custom_config = config.get('custom_config_key') %}
중첩된 후:
{% set my_custom_config = config.get('meta').custom_config_key %}
CustomOutputPathInSourceFreshnessDeprecation
dbt는 sources.json 파일 대상에서 소스 freshness 결과의 위치를 덮어쓰는 --output(또는 -o) 플래그를 deprecated했어요.
CustomOutputPathInSourceFreshnessDeprecation 해결
dbt source freshness 명령을 실행하는 어떤 job에서든 --output 또는 -o 플래그와 관련 경로 구성을 제거해요. 소스 freshness 결과만의 위치를 바꾸는 대안은 없어요. 하지만 --target-path로 해당 단계의 모든 아티팩트를 커스텀 위치에 쓸 수는 있어요.
CustomTopLevelKeyDeprecation
이 경고는 dbt가 지원하지 않는 커스텀 최상위 키를 YAML 파일에서 사용할 때 알려줘요.
이 deprecation 경고는 다음 어댑터에서만 발생해요:
- Snowflake
- Databricks
- BigQuery
- Redshift
CustomTopLevelKeyDeprecation 해결
YAML 파일의 커스텀 최상위 키를 config.meta 아래로 옮겨요.
예를 들어 custom_metadata 같은 커스텀 최상위 키를 사용한다면:
dbt_project.yml
models:
my_project:
staging:
+materialized: view
marts:
+materialized: table
custom_metadata:
owner: "data_team"
description: "This project contains models for our analytics platform"
last_updated: "2025-07-01"
키를 config.meta 아래로 옮겨야 해요:
dbt_project.yml
models:
my_project:
staging:
+materialized: view
marts:
+materialized: table
config:
meta:
custom_metadata:
owner: "data_team"
description: "This project contains models for our analytics platform"
last_updated: "2025-07-01"
DuplicateNameDistinctNodeTypesDeprecation
dbt는 같은 패키지의 두 버전 없는(unversioned) 리소스가 같은 이름을 공유하고(예: 둘 다 sales라는 모델과 시드) require_unique_project_resource_names 플래그가 false로 설정된 경우 이 경고를 발생시켜요. 이전에는 dbt가 항상 이 이름 충돌을 감지하지 않아, 중복 이름이 때로 잘못된 리소스를 가리킬 수 있었어요.
require_unique_project_resource_names 플래그가 true로 설정되면 dbt는 DuplicateResourceNameError를 발생시켜요. 자세한 내용은 Unique project resource names를 참고해요.
DuplicateNameDistinctNodeTypesDeprecation 해결
모든 이름이 고유해지도록 충돌하는 리소스 중 하나를 이름을 바꿔요.
DuplicateYAMLKeysDeprecation
이 경고는 profiles.yml에 동일한 키가 두 개 존재할 때 발생해요.
이전에는 profiles.yml 파일에 동일한 키가 있으면 dbt가 파일에 나열된 마지막 구성을 사용했어요.
profiles.yml
my_profile:
target:
outputs:
...
my_profile: # dbt would use this profile key
target:
outputs:
...
미래 버전에서는 dbt가 중복 키를 조용히 덮어쓰는 것을 중단할 거예요.
DuplicateYAMLKeysDeprecation 해결
profiles.yml 파일에서 중복 키를 제거해요.
EnvironmentVariableNamespaceDeprecation
dbt의 예약 네임스페이스 DBT_ENGINE과 충돌하는 환경 변수를 사용할 때 이 경고가 발생해요. 이전에는 dbt 내부 변수와 커스텀 변수 모두 DBT_ 접두사를 사용했어요. dbt에 정의된 환경 변수가 커스텀 환경 변수와 충돌하면 프로젝트가 깨질 수 있어요.
이제 모든 새 dbt 환경 변수는 DBT_ENGINE 접두사를 사용해 이름 충돌을 막고 사용자에게 미치는 혼란을 최소화해요.
EnvironmentVariableNamespaceDeprecation 해결
커스텀 환경 변수를 검토하고 dbt의 예약 네임스페이스 DBT_ENGINE과 충돌하지 않게 해요.
ExposureNameDeprecation
dbt 1.3에서 dbt는 exposures의 name 속성에 문자, 숫자, 밑줄만 허용하기 시작했어요.
예시:
CLI
23:55:00 [WARNING]: Deprecated functionality
Starting in v1.3, the 'name' of an exposure should contain only letters,
numbers, and underscores. Exposures support a new property, 'label', which may
contain spaces, capital letters, and special characters. stg_&customers does not
follow this pattern. Please update the 'name', and use the 'label' property for
a human-friendly title. This will raise an error in a future version of
dbt-core.
ExposureNameDeprecation 해결
exposure 이름이 문자, 숫자, 밑줄만 포함하게 해요. 더 사람이 읽기 좋은 이름은 exposure의 label 속성에 넣을 수 있어요.
GenerateSchemaNameNullValueDeprecation
dbt는 커스텀 generate_schema_name 매크로가 null 값을 반환할 때 이 deprecation 경고를 발생시켜요. null 스키마 이름을 반환하면 잘못되거나 예측할 수 없는 동작이 일어날 수 있어요.
이 deprecation 경고는 require_valid_schema_from_generate_schema_name 플래그가 false로 설정된 경우 발생해요. 플래그가 true로 설정되면 dbt는 파싱 중에 에러를 발생시켜요.
GenerateSchemaNameNullValueDeprecation 해결
프로젝트가 generate_schema_name 매크로를 정의한다면 유효한 스키마 이름을 반환하도록 업데이트해요. 예를 들어:
macros/get_custom_schema.sql
{% macro generate_schema_name(custom_schema_name, node) -%}
{%- if custom_schema_name is none -%}
{{ return(target.schema) }}
{%- else -%}
{{ custom_schema_name | trim }}
{%- endif -%}
{%- endmacro %}
GenericJSONSchemaValidationDeprecation
이 deprecation 유형은 catch-all/폴백이에요. dbt는 모든 JSON 스키마 검증 오류를 특정 deprecation 이벤트 유형으로 처리하려 시도하지만, 놓치는 경우가 있을 수 있어요. 놓친다는 것은 dbt가 특정 사례를 deprecation 이벤트로 처리하지 못했거나 JSON 스키마가 특정 영역에서 잘못됐다는 뜻이에요.
GenericJSONSchemaValidationDeprecation 해결
이 경고가 보인다면 안타깝게도 지금은 할 수 있는 일이 많지 않아요. 다만 이 deprecation이 발생하는 경우를 줄이기 위해 계속 노력하고 있어요. 보이는 특정 사례에 대한 안내가 필요하면 support에 연락(클라우드 기반 dbt platform 고객용)하거나 커뮤니티 Slack(dbt v1 사용자용)을 이용해요.
MFCumulativeTypeParamsDeprecation
dbt v1.9에서 metric의 type_params에 window와 time_to_grain을 직접 구현하는 게 deprecated됐어요.
예시:
CLI
15:36:22 [WARNING]: Cumulative fields `type_params.window` and
`type_params.grain_to_date` has been moved and will soon be deprecated. Please
nest those values under `type_params.cumulative_type_params.window` and
`type_params.cumulative_type_params.grain_to_date`. See documentation on
behavior changes:
https://docs.getdbt.com/reference/global-configs/behavior-changes.
MFCumulativeTypeParamsDeprecation 해결
관련 metric의 type_params 안의 cumulative_type_params 속성 아래 window와 time_to_grain을 중첩해요.
MFTimespineWithoutYamlConfigurationDeprecation
dbt v1.9 이전에는 MetricFlow 시간 스파인(time spine) 구성이 metricflow_time_spine.sql 파일에 저장됐어요. v1.9에서 dbt는 MetricFlow를 위한 YAML timespine 정의를 도입했어요. 이후 이것이 앞으로의 표준이 되기로 결정됐어요. 이 deprecation 경고가 보이면 Metricflow용 YAML timespine 정의가 없다는 뜻이에요.
예시:
CLI
19:56:41 [WARNING]: Time spines without YAML configuration are in the process of
deprecation. Please add YAML configuration for your 'metricflow_time_spine'
model. See documentation on MetricFlow time spines:
https://docs.getdbt.com/docs/build/metricflow-time-spine and behavior change
documentation:
https://docs.getdbt.com/reference/global-configs/behavior-changes
MFTimespineWithoutYamlConfigurationDeprecation 해결
MetricFlow timespine을 YAML로 정의해요.
MissingArgumentsPropertyInGenericTestDeprecation
dbt는 커스텀 제네릭 데이터 테스트나 대체 test_name 형식을 사용하는 데이터 테스트에서 속성으로 키워드 인자를 지정하는 걸 deprecated했어요. 대신 테스트의 인자는 새 arguments 속성 아래 지정해야 해요.
이 deprecation 경고는 require_generic_test_arguments_property 동작 플래그가 true로 설정된 경우에만 발생해요.
MissingArgumentsPropertyInGenericTestDeprecation 해결
이전에 커스텀 제네릭 테스트에서 인자를 최상위 속성으로 설정했다면:
model.yml
models:
- name: my_model_with_generic_test
data_tests:
- dbt_utils.expression_is_true:
expression: "order_items_subtotal = subtotal"
또는 대체 test_name 형식을 사용한다면:
model.yml
models:
- name: my_model_with_generic_test
data_tests:
- name: arbitrary_name
test_name: dbt_utils.expression_is_true
expression: "order_items_subtotal = subtotal"
where: "1=1"
이제 인자를 arguments 아래 중첩하고 프레임워크 구성은 config 아래 중첩해야 해요:
model.yml
models:
- name: my_model_with_generic_test
data_tests:
- dbt_utils.expression_is_true:
arguments:
expression: "order_items_subtotal = subtotal"
또는 프레임워크 구성과 함께:
model.yml
models:
- name: my_model_with_generic_test
data_tests:
- name: arbitrary_name
test_name: dbt_utils.expression_is_true
arguments:
expression: "order_items_subtotal = subtotal"
config:
where: "1=1"
MissingPlusPrefixDeprecation
dbt는 dbt_project.yml에서 + 접두사 없이 구성을 지정하는 걸 deprecated했어요. dbt_project.yml의 리소스 구성 안에서 폴더와 파일 이름만 + 접두사 없이 지정할 수 있어요.
예시:
CLI
18:16:06 [WARNING][MissingPlusPrefixDeprecation]: Deprecated functionality
Missing '+' prefix on `tags` found at `my_path.sub_path.another_path.tags` in
file `dbt_project.yml`. Hierarchical config
values without a '+' prefix are deprecated in dbt_project.yml.
이 deprecation 경고는 다음 어댑터에서만 발생해요:
- Snowflake
- Databricks
- BigQuery
- Redshift
MissingPlusPrefixDeprecation 해결
이전에 materialized 같은 영향을 받는 구성 중 하나를 + 없이 설정했다면:
dbt_project.yml
models:
marts:
materialized: table
이제 경로와 구분하기 위해 + 접두사로 설정해야 해요:
dbt_project.yml
models:
marts:
+materialized: table
ModelParamUsageDeprecation
--models / --model / -m 플래그는 dbt v0.21(2021년 10월)에서 --select / --s로 이름이 바뀌었어요. 이 플래그를 조용히 무시하면 명령의 선택 기준을 무시하는 셈이라, 작은 하위 집합만 선택하려다 전체 DAG를 빌드할 수도 있어요. 이 때문에 --models / --model / -m 플래그는 dbt v1.10에서 경고를, dbt v2에서 에러를 발생시킬 거예요. job 정의를 그에 맞게 업데이트해요.
ModelParamUsageDeprecation 해결
job 정의를 업데이트하고 --models / --model / -m 플래그를 제거하고 --select / --s로 대체해요.
ModulesItertoolsUsageDeprecation
dbt는 Jinja에서 modules.itertools를 사용하는 걸 deprecated했어요.
예시:
CLI
15:49:33 [WARNING]: Deprecated functionality
Usage of itertools modules is deprecated. Please use the built-in functions
instead.
ModulesItertoolsUsageDeprecation 해결
현재 Jinja SQL 템플릿에서 itertools 모듈의 함수를 사용한다면, 대신 사용 가능한 내장 dbt 함수와 Jinja 메서드를 사용해요.
예를 들어 다음 SQL 파일은:
models/itertools_usage.sql
{%- set A = [1, 2] -%}
{%- set B = ['x', 'y', 'z'] -%}
{%- set AB_cartesian = modules.itertools.product(A, B) -%}
{%- for item in AB_cartesian %}
{{ item }}
{%- endfor -%}
대체 내장 dbt Jinja 메서드를 사용하도록 변환해야 해요. 예를 들어:
macros/cartesian_product.sql
{%- macro cartesian_product(list1, list2) -%}
{%- set result = [] -%}
{%- for item1 in list1 -%}
{%- for item2 in list2 -%}
{%- set _ = result.append((item1, item2)) -%}
{%- endfor -%}
{%- endfor -%}
{{ return(result) }}
{%- endmacro -%}
models/itertools_usage.sql
{%- set A = [1, 2] -%}
{%- set B = ['x', 'y', 'z'] -%}
{%- set AB_cartesian = cartesian_product(A, B) -%}
{%- for item in AB_cartesian %}
{{ item }}
{%- endfor -%}
PackageInstallPathDeprecation
dbt deps 실행 시 패키지가 설치되는 기본 위치가 dbt_modules에서 dbt_packages로 업데이트됐어요. dbt clean 중에 dbt는 dbt_modules가 packages-install-path가 아님에도 dbt_project.yml의 clean-targets 속성에 정의되어 있음을 감지했어요.
예시:
CLI
22:48:01 [WARNING]: Deprecated functionality
The default package install path has changed from `dbt_modules` to
`dbt_packages`. Please update `clean-targets` in `dbt_project.yml` and
check `.gitignore`. Or, set `packages-install-path: dbt_modules`
If you'd like to keep the current value.
PackageInstallPathDeprecation 해결
다음은 권장되는 접근법이에요:
clean-targets스펙(및.gitignore)에서dbt_modules를dbt_packages로 바꿔요.- 패키지를 계속
dbt_modules에 설치하고 싶다면packages-install-path: dbt_modules로 설정해요.
PackageMaterializationOverrideDeprecation
설치된 패키지가 명시적 옵트인 없이 내장 materialization을 덮어쓸 수 있던 동작은 deprecated됐어요. dbt_project.yml에서 require_explicit_package_overrides_for_builtin_materializations 플래그를 false로 설정하면 내장 materialization의 이름과 일치하는 패키지가 검색·해결 순서에 계속 포함되도록 허용했어요.
PackageMaterializationOverrideDeprecation 해결
패키지에 정의된 materialization을 선호해 내장 materialization을 명시적으로 덮어써요. 루트 프로젝트에서 내장 materialization을 재구현하고 패키지 구현을 감싸면 돼요.
예를 들어:
{% materialization table, snowflake %}
{{ return (package_name.materialization_table_snowflake()) }}
{% endmaterialization %}
패키지에 대한 오버라이드를 추가한 후, dbt_project.yml에서 require_explicit_package_overrides_for_builtin_materializations: false 플래그를 제거해 경고를 해결해요.
PackageRedirectDeprecation
이 deprecation 경고는 packages.yml에 정의된, 현재 프로젝트에서 사용 중인 패키지의 이름이 바뀌었음을 뜻해요. 일반적으로 패키지 소유권이 바뀌거나 패키지 범위가 바뀌었을 때 발생해요. 현재 packages.yml에서 참조하는 패키지가 적극적으로 유지보수되지 않게 됐을 가능성이 높고(개발이 새 패키지 이름으로 옮겨갔기 때문에), 어느 시점엔 그 이름의 패키지가 dbt에서 작동을 멈출 거예요.
CLI
22:31:38 [WARNING]: Deprecated functionality
The `fishtown-analytics/dbt_utils` package is deprecated in favor of
`dbt-labs/dbt_utils`. Please update your `packages.yml` configuration to use
`dbt-labs/dbt_utils` instead.
PackageRedirectDeprecation 해결
packages.yml에서 이전 패키지 대신 새 패키지를 참조하기 시작해요.
ProjectFlagsMovedDeprecation
profiles.yml에서 구성할 수 있었던 config 속성은 dbt_project.yaml의 flags를 선호해 deprecated됐어요. 이 deprecation 경고가 보이면 dbt가 profiles.yml에서 config 속성을 감지했다는 뜻이에요.
예시:
CLI
00:08:12 [WARNING]: Deprecated functionality
User config should be moved from the 'config' key in profiles.yml to the 'flags' key in dbt_project.yml.
ProjectFlagsMovedDeprecation 해결
profiles.yml에서 config를 제거해요. profiles.yml에 있던 이전 config를 dbt_project.yml의 flags에 추가해요.
PropertyMovedToConfigDeprecation
일부 역사적 속성이 완전히 config로 옮겨지고 있어요.
이것에는 freshness, meta, tags, docs, group, access가 포함돼요.
특정 속성을 config로 변경하는 건 유익해요. dbt_project.yml에서 한 번에 많은 리소스에 설정할 수 있기 때문이에요(프로젝트 레벨/폴더 레벨 기본값). 속성과 config의 차이에 대한 자세한 내용은 여기를 참고해요.
PropertyMovedToConfigDeprecation 해결
이전에 freshness 같은 영향을 받는 속성 중 하나를 설정했다면:
sources:
- name: ecom
schema: raw
description: E-commerce data for the Jaffle Shop
freshness:
warn_after:
count: 24
period: hour
이제 config 아래에 설정해야 해요:
sources:
- name: ecom
schema: raw
description: E-commerce data for the Jaffle Shop
config:
freshness:
warn_after:
count: 24
period: hour
ResourceNamesWithSpacesDeprecation
dbt 1.8에서 리소스 이름에 공백을 두는 것을 deprecated했어요. 이 deprecation 경고를 받으면 dbt가 공백이 있는 리소스 이름을 감지했다는 뜻이에요.
예시:
CLI
16:37:58 [WARNING]: Found spaces in the name of `model.jaffle_shop.stg supplies`
ResourceNamesWithSpacesDeprecation 해결
위반한 리소스의 이름을 바꿔 이름에 공백이 없게 해요.
SourceFreshnessProjectHooksNotRun
이 경고가 보인다면 source_freshness_run_project_hooks 동작 플래그가 false로 설정되어 있고 on-run-start나 on-run-end가 정의되어 있다는 뜻이에요(docs). 이전에는 dbt source freshness를 실행할 때 프로젝트 훅이 소스에서 실행되지 않았어요.
예시:
CLI
19:51:56 [WARNING]: In a future version of dbt, the `source freshness` command
will start running `on-run-start` and `on-run-end` hooks by default. For more
information: https://docs.getdbt.com/reference/global-configs/legacy-behaviors
SourceFreshnessProjectHooksNotRun 해결
source_freshness_run_project_hooks를 true로 설정해요. dbt source freshness 실행 중 프로젝트 훅을 건너뛰는 방법은 behavior change 문서를 참고해요.
SourceOverrideDeprecation
소스의 overrides 속성은 deprecated됐어요.
이 deprecation 경고는 다음 어댑터에서만 발생해요:
- Snowflake
- Databricks
- BigQuery
- Redshift
SourceOverrideDeprecation 해결
overrides 속성을 제거하고 대신 패키지에서 소스를 활성화 또는 비활성화해요.
UnexpectedJinjaBlockDeprecation
예상치 못한 Jinja 블록(고아가 된 Jinja 블록 또는 매크로 컨텍스트 밖의 Jinja 블록)이 있으면 경고를 받고, 미래 버전에서는 dbt가 예상치 못한 Jinja 블록 지원을 중단할 거예요. 이전에는 이런 예상치 못한 Jinja 블록이 조용히 무시됐어요.
macros/my_macro.sql
{% endmacro %} # orphaned endmacro jinja block
{% macro hello() %}
hello!
{% endmacro %}
UnexpectedJinjaBlockDeprecation 해결
예상치 못한 Jinja 블록을 삭제해요.
WEOIncludeExcludeDeprecation
warn_error_options의 include와 exclude 옵션은 deprecated되고 각각 error와 warn으로 대체됐어요.
WEOIncludeExcludeDeprecation 해결
warn_error_options가 구성된 곳에서 다음을 바꿔요:
include를error로exclude를warn으로
예를 들어:
...
flags:
warn_error_options:
include:
- NoNodesForSelectionCriteria
이제 다음과 같이 구성해야 해요:
...
flags:
warn_error_options:
error:
- NoNodesForSelectionCriteria
더 알아보기 (Learn more)
- Deprecations은 미래 버전에서 제거될 예정인 기능에 대한 경고예요. 업그레이드 전에 해결하는 게 좋아요.
- 관련 개념: behavior change flags, dbt v2 업그레이드 가이드.