code: def test_invalid_sort_by() -> None:
      df = pl.DataFrame(
          {
              "a": ["bill", "bob", "jen", "allie", "george"],
              "b": ["M", "M", "F", "F", "M"],
              "c": [32, 40, 20, 19, 39],
          }
      )
  
      # `select a where b order by c desc`
      with pytest.raises(
          pl.ComputeError,
          match=r"`sort_by` produced different length \(5\) than the Series that has to be sorted \(3\)",
      ):
          df.select(
              pl.col("a")
              .filter(pl.col("b") == "M")
              .sort_by("c", descending=True)
          )
  
imports: from __future__ import annotations
  import io
  from datetime import date, datetime, time
  from decimal import Decimal
  from typing import TYPE_CHECKING, Any
  import numpy
  import pytest
  import polars
  from polars.datatypes.convert import dtype_to_py_type
  from polars.exceptions import InvalidOperationError
label_desc: Use image node_id 20 for calling a global function with example usage: test_invalid_sort_by() without return types