code: def test_max_rows(alt):
      basic_chart = make_basic_chart(alt)
  
      with alt.data_transformers.enable("default"):
          basic_chart.to_dict()  # this should not fail
  
      with alt.data_transformers.enable("default", max_rows=5):
          with pytest.raises(alt.MaxRowsError):
              basic_chart.to_dict()
  
file_path: altair/tests/vegalite/test_common.py
imports: import pytest
  import pandas
  from altair.vegalite import v5
label_desc: Use image node_id 7 for calling a global function with example usage: test_max_rows(alt) without return types