code: def test_convert_to_proto():
      data = {
          "Symbol": ["MSFT", "AAPL", "MSFT", "AAPL", "NFLX"],
          "Shares": [100, 170, 150, 200, None],
          "Access": [True, True, False, True, False],
          "All_Null": [None, None, None, None, None],
      }
      df = pd.DataFrame(data)
  
      expected_proto = text_format.Parse(
          """
          datasets {
            num_examples: 5
            features {
              name: "Symbol"
              type: STRING
              string_stats {
                common_stats {
                  num_non_missing: 5
                  num_missing: 0
                  min_num_values: 1
                  max_num_values: 1
                  avg_num_values: 1.0
                }
                unique: 3
                top_values {
                  value: "MSFT"
                  frequency: 2.0
                }
                top_values {
                  value: "AAPL"
                  frequency: 2.0
                }
                avg_length: 4.0
                rank_histogram {
                  buckets {
                    low_rank: 0
                    high_rank: 0
                    label: "MSFT"
                    sample_count: 2.0
                  }
                  buckets {
                    low_rank: 1
                    high_rank: 1
                    label: "AAPL"
                    sample_count: 2.0
                  }
                  buckets {
                    low_rank: 2
                    high_rank: 2
                    label: "NFLX"
                    sample_count: 1.0
                  }
                }
              }
              custom_stats {
                name: "data type"
                str: "object"
              }
            }
            features {
              name: "Shares"
              type: FLOAT
              num_stats {
                common_stats {
                  num_non_missing: 4
                  num_missing: 1
                  min_num_values: 1
                  max_num_values: 1
                  avg_num_values: 1.0
                }
                mean: 155.0
                std_dev: 42.03173404306164
                num_zeros: 0
                min: 100.0
                median: 160.0
                max: 200.0
                histograms {
                  buckets {
                    low_value: 100.0
                    high_value: 110.0
                    sample_count: 0.26666666666666666
                  }
                  buckets {
                    low_value: 110.0
                    high_value: 120.0
                    sample_count: 0.26666666666666666
                  }
                  buckets {
                    low_value: 120.0
                    high_value: 130.0
                    sample_count: 0.26666666666666666
                  }
                  buckets {
                    low_value: 130.0
                    high_value: 140.0
                    sample_count: 0.26666666666666666
                  }
                  buckets {
                    low_value: 140.0
                    high_value: 150.0
                    sample_count: 0.35555555555555557
                  }
                  buckets {
                    low_value: 150.0
                    high_value: 160.0
                    sample_count: 0.5777777777777778
                  }
                  buckets {
                    low_value: 160.0
                    high_value: 170.0
                    sample_count: 0.6285714285714286
                  }
                  buckets {
                    low_value: 170.0
                    high_value: 180.0
                    sample_count: 0.48253968253968255
                  }
                  buckets {
                    low_value: 180.0
                    high_value: 190.0
                    sample_count: 0.4444444444444445
                  }
                  buckets {
                    low_value: 190.0
                    high_value: 200.0
                    sample_count: 0.4444444444444445
                  }
                  type: STANDARD
                }
                histograms {
                  buckets {
                    low_value: 100.0
                    high_value: 115.0
                  }
                  buckets {
                    low_value: 115.0
                    high_value: 130.0
                  }
                  buckets {
                    low_value: 130.0
                    high_value: 145.0
                  }
                  buckets {
                    low_value: 145.0
                    high_value: 154.0
                  }
                  buckets {
                    low_value: 154.0
                    high_value: 160.0
                  }
                  buckets {
                    low_value: 160.0
                    high_value: 166.0
                  }
                  buckets {
                    low_value: 166.0
                    high_value: 173.0
                  }
                  buckets {
                    low_value: 173.0
                    high_value: 182.0
                  }
                  buckets {
                    low_value: 182.0
                    high_value: 191.0
                  }
                  buckets {
                    low_value: 191.0
                    high_value: 200.0
                  }
                  type: QUANTILES
                }
              }
              custom_stats {
                name: "data type"
                str: "float64"
              }
            }
            features {
              name: "Access"
              type: STRING
              string_stats {
                common_stats {
                  num_non_missing: 5
                  num_missing: 0
                  min_num_values: 1
                  max_num_values: 1
                  avg_num_values: 1.0
                }
                unique: 2
                top_values {
                  value: "True"
                  frequency: 3.0
                }
                top_values {
                  value: "False"
                  frequency: 2.0
                }
                avg_length: 0
                rank_histogram {
                  buckets {
                    low_rank: 0
                    high_rank: 0
                    label: "True"
                    sample_count: 3.0
                  }
                  buckets {
                    low_rank: 1
                    high_rank: 1
                    label: "False"
                    sample_count: 2.0
                  }
                }
              }
              custom_stats {
                name: "data type"
                str: "bool"
              }
            },
            features {
              name: "All_Null"
              type: STRING
              string_stats {
                common_stats {
                  num_non_missing: 0
                  num_missing: 5
                  min_num_values: 1
                  max_num_values: 1
                  avg_num_values: 1.0
                }
                unique: 0
                avg_length: 0.0
              }
              custom_stats {
                name: "data type"
                str: "object"
              }
            }
          }
          """,
          facet_feature_statistics_pb2.DatasetFeatureStatisticsList(),
      )
  
      converted_proto = pandas_renderer.convert_to_proto(df)
      assert converted_proto == expected_proto
  
file_path: mlflow/tests/recipes/cards/test_pandas_renderer.py
imports: import numpy
  import pandas
  import pytest
  from google.protobuf import text_format
  from mlflow.exceptions import MlflowException
  from mlflow.protos import facet_feature_statistics_pb2
  from mlflow.recipes.cards import pandas_renderer
label_desc: Use image node_id 5 for calling a global function with example usage: test_convert_to_proto() without return types