Dataset Turning into Int Inside For Loop

type or def runAction(self, event):
	This event is fired when the 'action' of the component occurs.

		self: A reference to the component that is invoking this function.
		event: An empty event object.
	#loop through dataset and send to sql
	#get dataSet parameters
	dataSet = self.parent.parent.parent.getChild("Table")
	rowCount = dataSet.getRowCount()
	modIndex = dataSet.getColumnIndex("modified")
	#get edited value indexes
	ignition_g_kpi_ndxIndex = dataSet.getColumnIndex("ignition_g_kpi_ndx")
	unitNumberIndex = dataSet.getColumnIndex("unitNumber")
	orderNumberIndex = dataSet.getColumnIndex("orderNumber")
	shiftIndex = dataSet.getColumnIndex("ShiftName")
	validIndex = dataSet.getColumnIndex("valid")
	commentsIndex = dataSet.getColumnIndex("comments")
	#loop through dataset and change any rows that have been modified
	self.parent.parent.parent.getChild("FlexContainer_0").getChild("Label").props.text = dataSet#test1
	for row in range(rowCount):
		dataSet = self.parent.parent.parent.getChild("Table")
		self.parent.parent.parent.getChild("FlexContainer_0").getChild("Label_0").props.text = dataSet#test2
		modified = dataSet.getValueAt(row, modIndex)
		if modified == 1:
			ignition_g_kpi_ndx = dataSet.getValueAt(row, ignition_g_kpi_ndxIndex)
			unitNumber = dataSet.getValueAt(row, unitNumberIndex)
			orderNumber = dataSet.getValueAt(row, orderNumberIndex)
			shift = dataSet.getValueAt(row, shiftIndex)
			valid = dataSet.getValueAt(row, validIndex)
			comments = dataSet.getValueAt(row, commentsIndex)
			dataSetOrderNumber =[0]['Order Number']
			#run named query to update dataset and return updated dataset
			namedQuery = "ignition_g_kpi Update"
			parameters = {"ignition_g_kpi_ndx":ignition_g_kpi_ndx, "unitNumberIndex":unitNumberIndex, "orderNumber":orderNumber, "shift":shift, "valid":valid, "comments":comments, "dataSetOrderNumber":dataSetOrderNumber} 
			dataSet = system.db.runNamedQuery(namedQuery, parameters)[0]['Order Number']
			#set dataset props to new dataset
			self.parent.parent.parent.getChild("Table") = dataSet
	#turn edit mode off
	self.view.params.edit = False

I've been trying to loop through a dataset to get the values at different rows.
I'm getting an error that I can't use getValueAt on an Int because it's not an attribute.

I then looked to see what's happening to my dataset and read it before and after the for loop and printed it to a label. Before the for loop I get my dataset, after the for loop it's turning into the int "1"
This happens even if I re define the dataset inside the for loop.

Any help would be appreciated, thanks!

You are using the dataSet variable for multiple purposes. Use different names for each purpose.