code: def test_date_part_and_grain_in_filter(  # noqa: D
      column_association_resolver: ColumnAssociationResolver,
      resolved_spec_lookup: FilterSpecResolutionLookUp,
      where_sql: str,
  ) -> None:
      where_filter = PydanticWhereFilter(where_sql_template=where_sql)
  
      where_filter_spec = WhereSpecFactory(
          column_association_resolver=column_association_resolver,
          spec_resolution_lookup=resolved_spec_lookup,
      ).create_from_where_filter(EXAMPLE_FILTER_LOCATION, where_filter)
  
      assert (
          where_filter_spec.where_sql
          == "metric_time__extract_year = '2020'"
      )
      assert where_filter_spec.linkable_spec_set == LinkableSpecSet(
          dimension_specs=(),
          time_dimension_specs=(
              TimeDimensionSpec(
                  element_name="metric_time",
                  entity_links=(),
                  time_granularity=TimeGranularity.WEEK,
                  date_part=DatePart.YEAR,
              ),
          ),
          entity_specs=(),
      )
  
imports: from __future__ import annotations
  import logging
  import pytest
  from dbt_semantic_interfaces.call_parameter_sets import DimensionCallParameterSet, EntityCallParameterSet, TimeDimensionCallParameterSet
  from dbt_semantic_interfaces.implementations.filters.where_filter import PydanticWhereFilter, PydanticWhereFilterIntersection
  from dbt_semantic_interfaces.naming.keywords import METRIC_TIME_ELEMENT_NAME
  from dbt_semantic_interfaces.protocols import WhereFilterIntersection
  from dbt_semantic_interfaces.references import DimensionReference, EntityReference, MetricReference, TimeDimensionReference
  from dbt_semantic_interfaces.type_enums.date_part import DatePart
  from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity
  from metricflow.naming.object_builder_scheme import ObjectBuilderNamingScheme
  from metricflow.query.group_by_item.filter_spec_resolution.filter_location import WhereFilterLocation
  from metricflow.query.group_by_item.filter_spec_resolution.filter_spec_lookup import CallParameterSet, FilterSpecResolution, FilterSpecResolutionLookUp, ResolvedSpecLookUpKey
  from metricflow.query.group_by_item.resolution_path import MetricFlowQueryResolutionPath
  from metricflow.query.issues.issues_base import MetricFlowQueryResolutionIssueSet
  from metricflow.specs.column_assoc import ColumnAssociationResolver
  from metricflow.specs.specs import DimensionSpec, EntitySpec, LinkableInstanceSpec, LinkableSpecSet, TimeDimensionSpec, WhereFilterSpec
  from metricflow.specs.where_filter_transform import WhereSpecFactory
  from metricflow.test.specs.conftest import EXAMPLE_FILTER_LOCATION
label_desc: Use image node_id 8 for calling a global function with example usage: test_date_part_and_grain_in_filter(column_association_resolver, resolved_spec_lookup, where_sql) without return types