code: def test_unset_sorted_flag_after_extend() -> None:
      df1 = pl.DataFrame({"Add": [37, 41], "Batch": [48, 49]}).sort(
          "Add"
      )
      df2 = pl.DataFrame({"Add": [37], "Batch": [67]}).sort("Add")
  
      df1.extend(df2)
      assert not df1["Add"].flags["SORTED_ASC"]
      df = df1.group_by("Add").agg([pl.col("Batch").min()]).sort("Add")
      assert df["Add"].flags["SORTED_ASC"]
      assert df.to_dict(as_series=False) == {
          "Add": [37, 41],
          "Batch": [48, 49],
      }
  
imports: from __future__ import annotations
  from datetime import date, datetime
  from typing import Any
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 15 for calling a global function with example usage: test_unset_sorted_flag_after_extend() without return types