Skip to content

Commit

Permalink
Upgrade black
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Sep 24, 2024
1 parent fb1588c commit 32ded80
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.3.0
hooks:
- id: black
verbose: true
Expand Down
4 changes: 3 additions & 1 deletion dbt-metricflow/dbt_metricflow/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,9 @@ def validate_configs(
).validate_semantic_manifest(semantic_manifest)

if not model_issues.has_blocking_issues:
semantic_spinner.succeed(f"🎉 Successfully validated the semantics of built manifest ({model_issues.summary()})")
semantic_spinner.succeed(
f"🎉 Successfully validated the semantics of built manifest ({model_issues.summary()})"
)
else:
semantic_spinner.fail(
f"Breaking issues found when checking semantics of built manifest ({model_issues.summary()})"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
classes, rather than the perhaps more natural approach of adding a to_spec() method on the model objects. These
shims likely point to the need for a bit of an internal refactor, but that's a concern for another time.
"""

from __future__ import annotations

from dbt_semantic_interfaces.protocols.measure import Measure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The naming of these classes is a little odd as they have the "For.." suffix. But using the "*ResolverInput" leads to
some confusing names like "ResolverInputForQuery" -> "QueryResolverInput". Improved naming for these classes is TBD.
"""

from __future__ import annotations

from dataclasses import dataclass
Expand Down
12 changes: 6 additions & 6 deletions metricflow/dataflow/builder/dataflow_plan_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1613,12 +1613,12 @@ def _build_aggregated_measure_from_measure_source_node(
non_additive_dimension_grain = self._semantic_model_lookup.get_defined_time_granularity(
TimeDimensionReference(non_additive_dimension_spec.name)
)
queried_time_dimension_spec: Optional[
TimeDimensionSpec
] = self._find_non_additive_dimension_in_linkable_specs(
agg_time_dimension=agg_time_dimension,
linkable_specs=queried_linkable_specs.as_tuple,
non_additive_dimension_spec=non_additive_dimension_spec,
queried_time_dimension_spec: Optional[TimeDimensionSpec] = (
self._find_non_additive_dimension_in_linkable_specs(
agg_time_dimension=agg_time_dimension,
linkable_specs=queried_linkable_specs.as_tuple,
non_additive_dimension_spec=non_additive_dimension_spec,
)
)
time_dimension_spec = TimeDimensionSpec(
# The NonAdditiveDimensionSpec name property is a plain element name
Expand Down
1 change: 1 addition & 0 deletions metricflow/plan_conversion/sql_expression_builders.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utility module for building sql expressions from inputs derived from dataflow plan or other nodes."""

from __future__ import annotations

from typing import List, Sequence
Expand Down
6 changes: 3 additions & 3 deletions metricflow/validation/data_warehouse_model_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,9 @@ def gen_measure_tasks(
source_node_by_measure_spec.update({measure_spec: source_node for measure_spec in measure_specs})
measure_specs_source_node_pair.append((measure_specs, source_node))

source_node_to_sub_task: DefaultDict[
DataflowPlanNode, List[DataWarehouseValidationTask]
] = collections.defaultdict(list)
source_node_to_sub_task: DefaultDict[DataflowPlanNode, List[DataWarehouseValidationTask]] = (
collections.defaultdict(list)
)
for spec in semantic_model_specs:
obtained_source_node = source_node_by_measure_spec.get(spec)
assert obtained_source_node, f"Unable to find generated source node for measure: {spec.element_name}"
Expand Down

0 comments on commit 32ded80

Please sign in to comment.