code: def test_spatial_index_not_dropped():
      # Issue 1121
      df = GeoDataFrame(
          {
              "some_geom": MultiPolygonArray(
                  [
                      [[[0, 0, 1, 0, 1, 1, 0, 1, 0, 0]]],
                      [[[0, 2, 1, 2, 1, 3, 0, 3, 0, 2]]],
                  ]
              ),
              "other": [
                  23,
                  45,
              ],  # This column is not used and will be dropped.
          }
      )
  
      assert df.some_geom.array._sindex is None
      sindex = df.some_geom.array.sindex
      assert sindex is not None
  
      glyph = ds.glyphs.polygon.PolygonGeom("some_geom")
      agg = ds.count()
  
      df2, _ = ds.core._bypixel_sanitise(df, glyph, agg)
  
      assert df2.columns == ["some_geom"]
      assert df2.some_geom.array._sindex == df.some_geom.array._sindex
  
file_path: datashader/datashader/tests/test_polygons.py
imports: import pytest
  import pandas
  import numpy
  import xarray
  import datashader
  from datashader.tests.test_pandas import assert_eq_ndarray, assert_eq_xr
  import dask.dataframe
label_desc: Use image node_id 8 for calling a global function with example usage: test_spatial_index_not_dropped() without return types