Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cosmos/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _create_cache_identifier(dag: DAG, task_group: TaskGroup | None) -> str:
task_group_id = metadata.get("task_group_id")

if dag_id:
cache_identifiers_list.append(dag_id)
cache_identifiers_list.append(dag_id.replace(".", "___"))
Comment thread
tatiana marked this conversation as resolved.
if task_group_id:
cache_identifiers_list.append(task_group_id.replace(".", "__"))

Expand Down
2 changes: 1 addition & 1 deletion tests/dbt/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ def test_save_dbt_ls_cache(mock_variable_set, mock_datetime, tmp_dbt_project_dir
assert hash_args == "d41d8cd98f00b204e9800998ecf8427e"
if sys.platform == "darwin":
# We faced inconsistent hashing versions depending on the version of MacOS/Linux - the following line aims to address these.
assert hash_dir in ("c2c47529eaec412281bdb243a479b734", "71bbf303ad4e06a7b1e2be20e0b73c0d")
assert hash_dir in ("e16e6aef5f03f4e12d744b9412d90272", "71bbf303ad4e06a7b1e2be20e0b73c0d")
Comment thread
tatiana marked this conversation as resolved.
else:
assert hash_dir == "71bbf303ad4e06a7b1e2be20e0b73c0d"

Expand Down
3 changes: 3 additions & 0 deletions tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@

START_DATE = datetime(2024, 4, 16)
example_dag = DAG("dag", start_date=START_DATE)
example_dag_with_dots = DAG("dag.with.dots", start_date=START_DATE)

SAMPLE_PARTIAL_PARSE_FILEPATH = Path(__file__).parent / "sample/partial_parse.msgpack"


@pytest.mark.parametrize(
"dag, task_group, result_identifier",
[
(example_dag, None, "dag"),
(example_dag_with_dots, None, "dag___with___dots"),
(None, TaskGroup(dag=example_dag, group_id="inner_tg"), "dag__inner_tg"),
(
None,
Expand Down