code: def test_propagate_extra_cols(spark, rg):
      num_samples = 50
      genotype_df = pd.DataFrame(rg.random((num_samples, 3)))
      phenotype_df = pd.DataFrame(
          random_phenotypes((num_samples, 5), rg)
      )
      covariate_df = pd.DataFrame(rg.random((num_samples, 2)))
      extra_cols = pd.DataFrame(
          {"genotype_idx": range(3), "animal": "monkey"}
      )
      results = run_logistic_regression_spark(
          spark, genotype_df, phenotype_df, covariate_df, extra_cols
      )
      assert (
          sorted(results["genotype_idx"].tolist())
          == [0] * 5 + [1] * 5 + [2] * 5
      )
      assert results.animal[results.animal == "monkey"].all()
      assert results.columns.tolist() == [
          "genotype_idx",
          "animal",
          "chisq",
          "pvalue",
          "phenotype",
      ]
  
imports: from pyspark.sql.types import ArrayType, DoubleType
  import glow.gwas.log_reg
  import glow.gwas.functions
  import statsmodels.api
  import pandas
  import numpy
  import pytest
label_desc: Use image node_id 25 for calling a global function with example usage: test_propagate_extra_cols(spark, rg) without return types