Custom Post Type author filter not working

You can try this code

<?php
add_action( 'restrict_manage_posts', 
'admin_posts_filter_restrict_manage_posts_by_author' );
/**
 * Create the drop down
 *
 * @return void
 */
function admin_posts_filter_restrict_manage_posts_by_author(){
if (isset($_GET['post_type']) && 'task' == $_GET['post_type']){
    wp_dropdown_users( array(
        'show_option_all' => __( 'Show All Authors', 'your-site' ),
        'name' => 'bcust_id',
        'selected' => $_GET['bcust_id']
    ));
  }
}
add_filter( 'parse_query', 'modify_query_to_filter_by_author' );
/**
 * Filter by author
 * @param  (wp_query object) $query
 *
 * @return Void
 */
function modify_query_to_filter_by_author( $query ){
global $pagenow;
if ( isset($_GET['post_type']) 
     && 'task' == $_GET['post_type'] 
     && is_admin() && 
     $pagenow == 'edit.php' 
     && isset($_GET['bcust_id']) 
     && $_GET['bcust_id'] != '') {
    $query->query_vars['author'] = $_GET['bcust_id'];
  }
}