language-extensions/python/test/src/PythonGetResultColumnTests.cpp
// Name: GetEmptyResultColumnTest
//
// Description:
//  Test GetResultColumn with a script that returns OutputDataSet with empty rows.
//

GetEmptyResultColumnTest
Description:
Test GetResultColumn with a script that returns OutputDataSet with empty rows.
GetEmptyResultColumnTest Description : Test GetResultColumn with a script that returns OutputDataSet with empty rows .
TEST_F(PythonExtensionApiTests, GetEmptyResultColumnTest)
	{
		string scriptString = "from pandas import DataFrame; import numpy as np;"
		"OutputDataSet = DataFrame({'intCol' : np.array([], dtype=np.int32)});"
		"print(OutputDataSet)";
		InitializeSession(0, 
			0,               
			scriptString);
		SQLUSMALLINT outputschemaColumnsNumber = 0;
		SQLRETURN result = Execute(
			*m_sessionId,
			m_taskId,
			0,
			nullptr,
			nullptr,
			&outputschemaColumnsNumber);
		ASSERT_EQ(result, SQL_SUCCESS);
		EXPECT_EQ(outputschemaColumnsNumber, 1);
		TestGetResultColumn(0,  
			SQL_C_SLONG,        
			m_IntSize,          
			0,                  
			SQL_NO_NULLS);      
	}
TEST_F ( PythonExtensionApiTests , GetEmptyResultColumnTest ) { string scriptString = " " " " " " ; InitializeSession ( 0 , 0 , scriptString ) ; SQLUSMALLINT outputschemaColumnsNumber = 0 ; SQLRETURN result = Execute ( * m_sessionId , m_taskId , 0 , nullptr , nullptr , & outputschemaColumnsNumber ) ; ASSERT_EQ ( result , SQL_SUCCESS ) ; EXPECT_EQ ( outputschemaColumnsNumber , 1 ) ; TestGetResultColumn ( 0 , SQL_C_SLONG , m_IntSize , 0 , SQL_NO_NULLS ) ; }
Name: GetEmptyResultColumnTest
Description:
Test GetResultColumn with a script that returns OutputDataSet with empty rows.
Name : GetEmptyResultColumnTest Description : Test GetResultColumn with a script that returns OutputDataSet with empty rows .
// Initialize with a Session that executes the above script
 // that creates an empty row 1 column OutputDataSet.
 //
 // parametersNumber
 // inputSchemaColumnsNumber
 // columnNumber
 // dataType
 // columnSize
 // decimalDigits
 // nullable
