@@ -671,15 +671,61 @@ def test_df_info(scalars_dfs):
671671 "dtypes: Float64(1), Int64(3), binary[pyarrow](1), boolean(1), date32[day][pyarrow](1), decimal128(38, 9)[pyarrow](1), duration[us][pyarrow](1), geometry(1), string(1), time64[us][pyarrow](1), timestamp[us, tz=UTC][pyarrow](1), timestamp[us][pyarrow](1)\n "
672672 "memory usage: 1341 bytes\n "
673673 )
674-
675674 scalars_df , _ = scalars_dfs
676- bf_result = io .StringIO ()
677675
676+ bf_result = io .StringIO ()
678677 scalars_df .info (buf = bf_result )
679678
680679 assert expected == bf_result .getvalue ()
681680
682681
682+ def test_df_info_no_rows (session ):
683+ expected = (
684+ "<class 'bigframes.dataframe.DataFrame'>\n "
685+ "Index: 0 entries\n "
686+ "Data columns (total 1 columns):\n "
687+ " # Column Non-Null Count Dtype\n "
688+ "--- -------- ---------------- -------\n "
689+ " 0 col 0 non-null Float64\n "
690+ "dtypes: Float64(1)\n "
691+ "memory usage: 0 bytes\n "
692+ )
693+ df = session .DataFrame ({"col" : []})
694+
695+ bf_result = io .StringIO ()
696+ df .info (buf = bf_result )
697+
698+ assert expected == bf_result .getvalue ()
699+
700+
701+ def test_df_info_no_cols (session ):
702+ expected = (
703+ "<class 'bigframes.dataframe.DataFrame'>\n "
704+ "Index: 3 entries, 1 to 3\n "
705+ "Empty DataFrame\n "
706+ )
707+ df = session .DataFrame ({}, index = [1 , 2 , 3 ])
708+
709+ bf_result = io .StringIO ()
710+ df .info (buf = bf_result )
711+
712+ assert expected == bf_result .getvalue ()
713+
714+
715+ def test_df_info_no_cols_no_rows (session ):
716+ expected = (
717+ "<class 'bigframes.dataframe.DataFrame'>\n "
718+ "Index: 0 entries\n "
719+ "Empty DataFrame\n "
720+ )
721+ df = session .DataFrame ({})
722+
723+ bf_result = io .StringIO ()
724+ df .info (buf = bf_result )
725+
726+ assert expected == bf_result .getvalue ()
727+
728+
683729@pytest .mark .parametrize (
684730 ("include" , "exclude" ),
685731 [
0 commit comments