code: def log_metadata(
      datetime,
      n_samples,
      n_variants,
      n_covariates,
      n_binary_phenotypes,
      method,
      test,
      library,
      spark_version,
      node_type_id,
      n_workers,
      start_time,
      end_time,
      run_metadata_delta_path,
  ):
      """
      log metadata about each step in the pipeline and append to delta lake table
      """
      spark.sql(
          "RESET"
      )  # resetting the runtime configurations specific to the current session is necessary to avoid `com.databricks.sql.io.FileReadException: Error while reading file`
      runtime = float("{:.2f}".format((end_time - start_time)))
      n_cores = lookup_cores(
          node_type_id,
          n_workers,
          node_to_core_mapping=node_to_core_mapping,
      )
      l = [
          (
              datetime,
              n_samples,
              n_variants,
              n_covariates,
              n_binary_phenotypes,
              method,
              test,
              library,
              spark_version,
              node_type_id,
              n_workers,
              n_cores,
              runtime,
          )
      ]
      run_metadata_delta_df = spark.createDataFrame(l, schema=schema)
      run_metadata_delta_df.write.mode("append").format("delta").save(
          run_metadata_delta_path
      )
  
file_path: glow/docs/source/_static/zzz_GENERATED_NOTEBOOK_SOURCE/2_setup_metadata.py
imports: import pyspark.sql.functions
  from pyspark.sql.types import *
  from databricks_cli.sdk.service import JobsService
  from databricks_cli.sdk.service import ClusterService
  from databricks_cli.configure.config import _get_api_client
  from databricks_cli.configure.provider import get_config
  from pathlib import Path
label_desc: Use image node_id 2 for calling a global function with example usage: log_metadata(datetime, n_samples, n_variants, n_covariates, n_binary_phenotypes, method, test, library, spark_version, node_type_id, n_workers, start_time, end_time, run_metadata_delta_path) without return types