From 3807049216df26f01d03325a31d2ee2dfcb8eba4 Mon Sep 17 00:00:00 2001 From: Mathieu Larose Date: Mon, 7 Oct 2024 10:37:35 -0400 Subject: [PATCH] use dagster._core.storage.tags --- python_modules/dagster/dagster/_cli/api.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python_modules/dagster/dagster/_cli/api.py b/python_modules/dagster/dagster/_cli/api.py index 567b722b02147..d0d348fc983d2 100644 --- a/python_modules/dagster/dagster/_cli/api.py +++ b/python_modules/dagster/dagster/_cli/api.py @@ -36,6 +36,7 @@ get_python_environment_entry_point, ) from dagster._core.storage.dagster_run import DagsterRun, DagsterRunStatus +from dagster._core.storage.tags import RUN_METRIC_TAGS from dagster._core.types.loadable_target_origin import LoadableTargetOrigin from dagster._core.utils import FuturesAwareThreadPoolExecutor from dagster._grpc import DagsterGrpcClient, DagsterGrpcServer @@ -87,9 +88,7 @@ def send_to_buffer(event): def _should_start_metrics_thread(dagster_run: DagsterRun) -> bool: - return get_boolean_tag_value( - dagster_run.tags.get("dagster/run_metrics") - ) or get_boolean_tag_value(dagster_run.tags.get(".dagster/run_metrics")) + return any(get_boolean_tag_value(dagster_run.tags.get(tag)) for tag in RUN_METRIC_TAGS) def _enable_python_runtime_metrics(dagster_run: DagsterRun) -> bool: