language-extensions/python/test/src/PythonGetResultColumnTests.cpp
// Name: MixedColumnNamesTest
//
// Description:
//  Test GetResultColumn with a script that returns a dataset with mixed type column names
//  i.e. integer and string.
//  This makes sure that we can access columns with integer column names.
//

MixedColumnNamesTest
Description:
Test GetResultColumn with a script that returns a dataset with mixed type column names
i.e. integer and string.
This makes sure that we can access columns with integer column names.
MixedColumnNamesTest Description : Test GetResultColumn with a script that returns a dataset with mixed type column names i . e . integer and string . This makes sure that we can access columns with integer column names .
TEST_F(PythonExtensionApiTests, MixedColumnNamesTest)
	{
		string scriptString = "from pandas import DataFrame;"
			"OutputDataSet = DataFrame([['ABC', 123],['DEF', 456]], columns=[3, 'col2']);"
			"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, 2);
		TestGetResultColumn(0,  
			SQL_C_CHAR,         
			3,                  
			0,                  
			SQL_NO_NULLS);      
		TestGetResultColumn(1,  
			SQL_C_SBIGINT,      
			m_BigIntSize,       
			0,                  
			SQL_NO_NULLS);      
	}
TEST_F ( PythonExtensionApiTests , MixedColumnNamesTest ) { 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 , 2 ) ; TestGetResultColumn ( 0 , SQL_C_CHAR , 3 , 0 , SQL_NO_NULLS ) ; TestGetResultColumn ( 1 , SQL_C_SBIGINT , m_BigIntSize , 0 , SQL_NO_NULLS ) ; }
Name: MixedColumnNamesTest
Description:
Test GetResultColumn with a script that returns a dataset with mixed type column names
i.e.
Name : MixedColumnNamesTest Description : Test GetResultColumn with a script that returns a dataset with mixed type column names i . e .
// With this script, we create a DataFrame with unusual column names.
 // This tests non-string and mixed type column names.
 //
 // Initialize with a Session that executes the above script
 // that creates an OutputDataSet with mixed column names.
 //
 // parametersNumber
 // inputSchemaColumnsNumber
 // columnNumber
 // dataType
 // columnSize
 // decimalDigits
 // nullable
 // columnNumber
 // dataType
 // columnSize
 // decimalDigits
 // nullable
