Skip to content

Commit

Permalink
Merge branch 'main' into catalog_schema_dbt_common
Browse files Browse the repository at this point in the history
  • Loading branch information
aranke authored May 29, 2024
2 parents cb7b061 + d8e38c1 commit b47b3be
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20240529-102814.yaml
Original file line number Diff line number Diff line change
@@ -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"
14 changes: 10 additions & 4 deletions core/dbt/cli/requires.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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

Expand Down

0 comments on commit b47b3be

Please sign in to comment.