def filter_dataset(
    dataset: pd.DataFrame,
    category_column: str,
    name_column: str,
    all_rows: bool = False,
) -> pd.DataFrame:
    """
    Filter dataset to include only rows with missing categories but existing names.

    Args:
        dataset (pd.DataFrame): Dataset to filter
        category_column (str): Column name containing categories
        name_column (str): Column name containing instrument names
        all_rows (bool, optional): If True, include all rows with names. Defaults to False.

    Returns:
        pd.DataFrame: Filtered dataset
    """
    if all_rows:
        return dataset[~dataset[name_column].isna()]
    return dataset[dataset[category_column].isna() & ~dataset[name_column].isna()]

    Filter dataset to include only rows with missing categories but existing names.

    Args:
        dataset (pd.DataFrame): Dataset to filter
        category_column (str): Column name containing categories
        name_column (str): Column name containing instrument names
        all_rows (bool, optional): If True, include all rows with names. Defaults to False.

    Returns:
        pd.DataFrame: Filtered dataset
    
parsers/industry_controller.py