def testH2OFrameToDataframe(hc):
    frame = h2o.upload_file(
        generic_test_utils.locate("smalldata/prostate/prostate.csv"))
    df = hc.as_spark_frame(frame)
    assert df.count() == frame.nrow, "Number of rows should match"
    assert len(df.columns) == frame.ncol, "Number of columns should match"
    assert df.columns == frame.names, "Column names should match"
def testH2OFrameToDataframeWithSecondConversion(hc):
    h2o_frame = h2o.upload_file(generic_test_utils.locate("smalldata/prostate/prostate.csv"))
    df1 = hc.as_spark_frame(h2o_frame)
    df2 = hc.as_spark_frame(h2o_frame)
    assert df1.count() == df2.count(), "Number of rows should match"
    assert len(df1.columns) == len(df2.columns), "Number of columns should match"
    assert df1.columns == df2.columns, "Column names should match"