code: def test_primary_time_dimension_if_only_time_rule() -> (
      None
  ):  # noqa: D
      table = SqlTable.from_string("db.schema.table")
      single_time_col_warehouse = DataWarehouseInferenceContext(
          table_props=[
              TableProperties(
                  table=table,
                  column_props=[
                      get_column_properties(
                          "db.schema.table.id",
                          InferenceColumnType.INTEGER,
                          True,
                      ),
                      get_column_properties(
                          "db.schema.table.time",
                          InferenceColumnType.DATETIME,
                          True,
                      ),
                  ],
              )
          ]
      )
      single_time_col_signals = (
          defaults.PrimaryTimeDimensionIfOnlyTimeRule().process(
              single_time_col_warehouse
          )
      )
      assert len(single_time_col_signals) == 1
      assert single_time_col_signals[0].column == SqlColumn.from_string(
          "db.schema.table.time"
      )
      assert (
          single_time_col_signals[0].type_node
          == InferenceSignalType.DIMENSION.PRIMARY_TIME
      )
  
      many_time_col_warehouse = DataWarehouseInferenceContext(
          table_props=[
              TableProperties(
                  table=table,
                  column_props=[
                      get_column_properties(
                          "db.schema.table.id",
                          InferenceColumnType.INTEGER,
                          True,
                      ),
                      get_column_properties(
                          "db.schema.table.time",
                          InferenceColumnType.DATETIME,
                          True,
                      ),
                      get_column_properties(
                          "db.schema.table.othertime",
                          InferenceColumnType.DATETIME,
                          True,
                      ),
                  ],
              )
          ]
      )
      many_time_col_signals = (
          defaults.PrimaryTimeDimensionIfOnlyTimeRule().process(
              many_time_col_warehouse
          )
      )
      assert len(many_time_col_signals) == 0
  
file_path: metricflow/metricflow/test/inference/rule/test_defaults.py
imports: from __future__ import annotations
  import metricflow.inference.rule.defaults
  from metricflow.dataflow.sql_column import SqlColumn
  from metricflow.dataflow.sql_table import SqlTable
  from metricflow.inference.context.data_warehouse import ColumnProperties, DataWarehouseInferenceContext, InferenceColumnType, TableProperties
  from metricflow.inference.models import InferenceSignalType
label_desc: Use image node_id 7 for calling a global function with example usage: test_primary_time_dimension_if_only_time_rule() without return types