Skip to content

Commit

Permalink
Move logging-related items to mf_logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
plypaul committed Jan 5, 2024
1 parent 3b36c4c commit 4d38041
Show file tree
Hide file tree
Showing 26 changed files with 38 additions and 34 deletions.
2 changes: 1 addition & 1 deletion metricflow/cli/dbt_connectors/adapter_backed_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from dbt_semantic_interfaces.pretty_print import pformat_big_objects

from metricflow.errors.errors import SqlBindParametersNotSupportedError
from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.protocols.sql_client import SqlEngine
from metricflow.random_id import random_id
from metricflow.sql.render.big_query import BigQuerySqlQueryPlanRenderer
Expand Down
2 changes: 1 addition & 1 deletion metricflow/dataflow/builder/dataflow_plan_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity
from dbt_semantic_interfaces.validations.unique_valid_name import MetricFlowReservedKeywords

from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.dag.id_generation import DATAFLOW_PLAN_PREFIX, IdGeneratorRegistry
from metricflow.dataflow.builder.node_data_set import DataflowPlanNodeOutputDataSetResolver
from metricflow.dataflow.builder.node_evaluator import (
Expand Down Expand Up @@ -60,6 +59,7 @@
from metricflow.dataset.dataset import DataSet
from metricflow.errors.errors import UnableToSatisfyQueryError
from metricflow.filters.time_constraint import TimeRangeConstraint
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
from metricflow.plan_conversion.column_resolver import DunderColumnAssociationResolver
from metricflow.plan_conversion.node_processor import PreJoinNodeProcessor
Expand Down
2 changes: 1 addition & 1 deletion metricflow/engine/metricflow_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from metricflow.execution.execution_plan_to_text import execution_plan_to_text
from metricflow.execution.executor import SequentialPlanExecutor
from metricflow.filters.time_constraint import TimeRangeConstraint
from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
from metricflow.model.semantics.linkable_element_properties import (
LinkableElementProperties,
Expand Down
4 changes: 4 additions & 0 deletions metricflow/mf_logging/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Contains logging-related classes / functions.
Named with the 'mf_' prefix to avoid collision with the built-in module.
"""
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from pydantic import BaseModel

from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from dbt_semantic_interfaces.type_enums import MetricType
from typing_extensions import override

from metricflow.collection_helpers.pretty_print import mf_pformat, mf_pformat_many
from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.mf_logging.pretty_print import mf_pformat, mf_pformat_many
from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
from metricflow.model.semantics.linkable_element_properties import LinkableElementProperties
from metricflow.query.group_by_item.candidate_push_down.group_by_item_candidate import GroupByItemCandidateSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from typing_extensions import override

from metricflow.collection_helpers.merger import Mergeable
from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.query.group_by_item.filter_spec_resolution.filter_location import WhereFilterLocation
from metricflow.query.group_by_item.path_prefixable import PathPrefixable
from metricflow.query.group_by_item.resolution_path import MetricFlowQueryResolutionPath
Expand Down
4 changes: 2 additions & 2 deletions metricflow/query/group_by_item/group_by_item_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from dbt_semantic_interfaces.references import TimeDimensionReference
from dbt_semantic_interfaces.type_enums import TimeGranularity

from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
from metricflow.naming.object_builder_scheme import ObjectBuilderNamingScheme
from metricflow.query.group_by_item.candidate_push_down.push_down_visitor import (
Expand Down
2 changes: 1 addition & 1 deletion metricflow/query/group_by_item/resolution_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from typing_extensions import override

from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.query.group_by_item.path_prefixable import PathPrefixable
from metricflow.query.group_by_item.resolution_dag.resolution_nodes.base_node import GroupByItemResolutionNode

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from dbt_semantic_interfaces.protocols import WhereFilter
from typing_extensions import override

from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.query.group_by_item.resolution_path import MetricFlowQueryResolutionPath
from metricflow.query.issues.issues_base import (
MetricFlowQueryIssueType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from typing_extensions import override

from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.naming.object_builder_scheme import ObjectBuilderNamingScheme
from metricflow.query.group_by_item.candidate_push_down.group_by_item_candidate import GroupByItemCandidateSet
from metricflow.query.group_by_item.resolution_path import MetricFlowQueryResolutionPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from typing_extensions import override

from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.query.group_by_item.resolution_path import MetricFlowQueryResolutionPath
from metricflow.query.issues.issues_base import (
MetricFlowQueryIssueType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from typing_extensions import override

from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.naming.object_builder_scheme import ObjectBuilderNamingScheme
from metricflow.query.group_by_item.candidate_push_down.group_by_item_candidate import GroupByItemCandidateSet
from metricflow.query.group_by_item.resolution_dag.resolution_nodes.base_node import GroupByItemResolutionNode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from typing_extensions import override

from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.query.group_by_item.resolution_path import MetricFlowQueryResolutionPath
from metricflow.query.issues.issues_base import (
MetricFlowQueryIssueType,
Expand Down
4 changes: 2 additions & 2 deletions metricflow/query/issues/parsing/invalid_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from typing_extensions import override

from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.query.group_by_item.resolution_path import MetricFlowQueryResolutionPath
from metricflow.query.issues.issues_base import (
MetricFlowQueryIssueType,
Expand Down
4 changes: 2 additions & 2 deletions metricflow/query/query_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
from dbt_semantic_interfaces.type_enums import TimeGranularity

from metricflow.assert_one_arg import assert_at_most_one_arg_set
from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.filters.merge_where import merge_to_single_where_filter
from metricflow.filters.time_constraint import TimeRangeConstraint
from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
from metricflow.naming.dunder_scheme import DunderNamingScheme
from metricflow.naming.metric_scheme import MetricNamingScheme
Expand Down
2 changes: 1 addition & 1 deletion metricflow/query/query_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing_extensions import override

from metricflow.collection_helpers.merger import Mergeable
from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.query.group_by_item.filter_spec_resolution.filter_spec_lookup import FilterSpecResolutionLookUp
from metricflow.query.group_by_item.resolution_dag.dag import GroupByItemResolutionDag
from metricflow.query.issues.issues_base import MetricFlowQueryResolutionIssueSet
Expand Down
2 changes: 1 addition & 1 deletion metricflow/query/query_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from dbt_semantic_interfaces.references import MetricReference

from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.dag.dag_to_text import dag_as_text
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
from metricflow.naming.metric_scheme import MetricNamingScheme
from metricflow.query.group_by_item.filter_spec_resolution.filter_pattern_factory import WhereFilterPatternFactory
Expand Down
4 changes: 2 additions & 2 deletions metricflow/query/resolver_inputs/query_resolver_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from dbt_semantic_interfaces.protocols import WhereFilterIntersection
from typing_extensions import override

from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.naming.metric_scheme import MetricNamingScheme
from metricflow.naming.naming_scheme import QueryItemNamingScheme
from metricflow.protocols.query_parameter import GroupByParameter, MetricQueryParameter, OrderByQueryParameter
Expand Down
4 changes: 2 additions & 2 deletions metricflow/test/collection_helpers/test_pretty_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from dbt_semantic_interfaces.implementations.elements.dimension import PydanticDimension
from dbt_semantic_interfaces.type_enums import DimensionType

from metricflow.collection_helpers.pretty_print import mf_pformat, mf_pformat_many
from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.mf_logging.pretty_print import mf_pformat, mf_pformat_many
from metricflow.test.time.metric_time_dimension import MTD_SPEC_DAY

logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from dbt_semantic_interfaces.pretty_print import pformat_big_objects

from metricflow.dataflow.sql_table import SqlTable
from metricflow.formatting import indent_log_line
from metricflow.mf_logging.formatting import indent_log_line
from metricflow.protocols.sql_client import (
SqlClient,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from dbt_semantic_interfaces.references import MetricReference
from dbt_semantic_interfaces.transformations.transform_rule import SemanticManifestTransformRule

from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
from metricflow.naming.naming_scheme import QueryItemNamingScheme
from metricflow.query.group_by_item.filter_spec_resolution.filter_pattern_factory import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from _pytest.fixtures import FixtureRequest
from dbt_semantic_interfaces.naming.keywords import METRIC_TIME_ELEMENT_NAME

from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
from metricflow.naming.naming_scheme import QueryItemNamingScheme
from metricflow.naming.object_builder_scheme import ObjectBuilderNamingScheme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from dbt_semantic_interfaces.enum_extension import assert_values_exhausted
from dbt_semantic_interfaces.naming.keywords import METRIC_TIME_ELEMENT_NAME

from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
from metricflow.naming.naming_scheme import QueryItemNamingScheme
from metricflow.naming.object_builder_scheme import ObjectBuilderNamingScheme
Expand Down
2 changes: 1 addition & 1 deletion metricflow/test/snapshot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
from _pytest.fixtures import FixtureRequest
from dbt_semantic_interfaces.pretty_print import pformat_big_objects

from metricflow.collection_helpers.pretty_print import mf_pformat
from metricflow.dag.mf_dag import MetricFlowDag
from metricflow.dataflow.dataflow_plan import DataflowPlan
from metricflow.dataflow.dataflow_plan_to_text import dataflow_plan_as_text
from metricflow.execution.execution_plan import ExecutionPlan
from metricflow.execution.execution_plan_to_text import execution_plan_to_text
from metricflow.mf_logging.pretty_print import mf_pformat
from metricflow.model.semantics.linkable_spec_resolver import LinkableElementSet
from metricflow.naming.object_builder_scheme import ObjectBuilderNamingScheme
from metricflow.protocols.sql_client import SqlClient
Expand Down

0 comments on commit 4d38041

Please sign in to comment.