Different number posts per page based on custom post type term id

Trying to cobble together a function from various suggestions that sets the number of posts per page based on the custom post type category in question. For instance, an "Alphabetical" category contains 3500+ posts, so I want pagination, but a child category "A" contains 100 posts and I want to show them all without pagination. The term_id for "A" is 1858, for "Alphabetical" is 1853. Can I check for specific term ids in a conditional? Not like this of course, which was just guessing…

add_filter('pre_get_posts', 'limit_change_posts_archive'); function limit_change_posts_archive($  query){     if ( is_archive && is_tax( 'pdsh_categories' ) && is_term( 1858 ) {     $  query->set('posts_per_page', -1); } return $  query;