def get_counts_for_unique_users(column_name, spark_df, print_result=False):
    """Generates a dataframe having counts for a particular column for unique users

    Args:
        column_name (str): Name of the column
        spark_df (pyspark.sql.dataframe.DataFrame): The pyspark dataframe
        print_result (bool, optional): Flag to print the result. Defaults to False.

    Returns:
        pandas.DataFrame: Resultant DataFrame
    """

    pd_df = spark_df.select("userId", column_name).distinct().groupBy(column_name).count().toPandas()

    if print_result:
        print(pd_df)

    return pd_df