code: def validate_limit(limit: Optional[str]) -> Optional[int]:
      """Validates and transform limit input."""
      if limit and not limit.isnumeric():
          raise click.BadParameter(
              "limit must be an int. For no limit, do not pass this argument"
          )
      return int(limit) if limit else None
  
file_path: metricflow/metricflow/cli/utils.py
imports: from __future__ import annotations
  import datetime
  import logging
  import pathlib
  import traceback
  from functools import update_wrapper, wraps
  from typing import Any, Callable, List, Optional
  import click
  from dateutil.parser import parse
  import metricflow.cli.custom_click_types
  from metricflow.cli.cli_context import CLIContext
label_desc: Use image node_id 5 for calling a global function with example usage: validate_limit(limit) and returns: unknown