diff --git a/.changes/unreleased/Under the Hood-20240529-102814.yaml b/.changes/unreleased/Under the Hood-20240529-102814.yaml new file mode 100644 index 00000000000..7ec6750a765 --- /dev/null +++ b/.changes/unreleased/Under the Hood-20240529-102814.yaml @@ -0,0 +1,6 @@ +kind: Under the Hood +body: Enable record filtering by type. +time: 2024-05-29T10:28:14.547624-05:00 +custom: + Author: emmyoop + Issue: "10240" diff --git a/core/dbt/cli/requires.py b/core/dbt/cli/requires.py index c9d38c55eec..01425d8db9b 100644 --- a/core/dbt/cli/requires.py +++ b/core/dbt/cli/requires.py @@ -41,7 +41,12 @@ from dbt_common.events.helpers import get_json_string_utcnow from dbt_common.exceptions import DbtBaseException as DbtException from dbt_common.invocation import reset_invocation_id -from dbt_common.record import Recorder, RecorderMode, get_record_mode_from_env +from dbt_common.record import ( + Recorder, + RecorderMode, + get_record_mode_from_env, + get_record_types_from_env, +) from dbt_common.utils import cast_dict_to_dict_of_strings @@ -101,13 +106,14 @@ def wrapper(*args, **kwargs): def setup_record_replay(): rec_mode = get_record_mode_from_env() + rec_types = get_record_types_from_env() recorder: Optional[Recorder] = None if rec_mode == RecorderMode.REPLAY: - recording_path = os.environ["DBT_REPLAY"] - recorder = Recorder(RecorderMode.REPLAY, recording_path) + recording_path = os.environ.get("DBT_RECORDER_FILE_PATH") + recorder = Recorder(RecorderMode.REPLAY, types=rec_types, recording_path=recording_path) elif rec_mode == RecorderMode.RECORD: - recorder = Recorder(RecorderMode.RECORD) + recorder = Recorder(RecorderMode.RECORD, types=rec_types) get_invocation_context().recorder = recorder