code: def test_return_type_inference_id(es):
      # direct features should keep foreign key tag
      direct_id_feature = Feature(
          es["sessions"].ww["customer_id"], "log"
      )
      assert (
          "foreign_key" in direct_id_feature.column_schema.semantic_tags
      )
  
      # aggregations of foreign key types should get converted
      last_feat = Feature(
          es["log"].ww["session_id"],
          parent_dataframe_name="customers",
          primitive=Last,
      )
      assert "foreign_key" not in last_feat.column_schema.semantic_tags
      assert isinstance(last_feat.column_schema.logical_type, Integer)
  
      # also test direct feature of aggregation
      last_direct = Feature(last_feat, "sessions")
      assert (
          "foreign_key" not in last_direct.column_schema.semantic_tags
      )
      assert isinstance(last_direct.column_schema.logical_type, Integer)
  
imports: import os.path
  import re
  import pytest
  from pympler.asizeof import asizeof
  from woodwork.column_schema import ColumnSchema
  from woodwork.logical_types import Datetime, Integer
  from featuretools import Feature, config, feature_base
  from featuretools.feature_base import IdentityFeature
  from featuretools.primitives import Count, Diff, Last, Mode, Negate, NMostCommon, NumUnique, Sum, TransformPrimitive
  from featuretools.synthesis.deep_feature_synthesis import can_stack_primitive_on_inputs
  from featuretools.tests.testing_utils import check_rename
label_desc: Use image node_id 10 for calling a global function with example usage: test_return_type_inference_id(es) without return types