code: def test_popularity_handler(
      self, mock_handler, lightfm_interaction_data
  ):
      # create project
      self.run_sql("create database proj")
      self.set_handler(
          mock_handler,
          name="pg",
          tables={"df": lightfm_interaction_data},
      )
  
      # create predictor
      self.run_sql(
          """
              create model proj.modelx
              from pg (select * from df)
              predict movieId
              using
                  engine='popularity_recommender',
                  item_id='movieId',
                  user_id='userId',
                  n_recommendations=10
                  """
      )
      self.wait_predictor("proj", "modelx")
  
      result_df = self.run_sql(
          """
              SELECT p.*
              FROM pg.df as t
              JOIN proj.modelx as p
              """
      )
  
      assert not result_df.empty
  
      # ensure that we have the right number of recommendations per user id
      assert result_df.userId.value_counts().isin([10]).all()
  
      # check we have predictions for all user_ids
      assert set(lightfm_interaction_data.userId.unique()) == set(
          result_df.userId.unique()
      )
  
file_path: mindsdb/tests/unit/ml_handlers/test_popularity_recommender.py
imports: import time
  from unittest.mock import patch
  import pandas
  from mindsdb_sql import parse_sql
  from unit.executor_test_base import BaseExecutorTest
label_desc: Use image node_id 3 for calling the TestPopularityRecommender obj's underlying member method code with example usage: obj.test_popularity_handler(mock_handler, lightfm_interaction_data) without return types