for index, row in tarefas.cronograma_df.iterrows():
cursor.execute("INSERT INTO stage.SomeTableAPI (id,_id,Posicao,Item,Descricao,Porcentagem) values(?,?,?,?,?,?)"
,row.id ,row._id ,row.posicao,row.item ,row.descricao ,row.porcentagem)
I received the following error message: pyodbc.ProgrammingError: ('Invalid parameter type. param-index=3 param-type=method', 'HY105')
Apparently "item" is already a reserved method name for the object.
Even after reading the documentation and following the solution described therein, the problem persisted. I managed to get around the problem and I leave a suggestion below on how I resolved it.
Method present in the documentation:
row.__getattribute__('My Value')
What solved it:
row["My Value"]
But I'm wondering if there's an official way recommended by the library. Maybe adding a warning in the documentation would be good, in case you access columns with the same name as a reserved attribute.
Environment
Issue
When executing this insert command:
I received the following error message:
pyodbc.ProgrammingError: ('Invalid parameter type. param-index=3 param-type=method', 'HY105')
Apparently "item" is already a reserved method name for the object.Even after reading the documentation and following the solution described therein, the problem persisted. I managed to get around the problem and I leave a suggestion below on how I resolved it.
Method present in the documentation:
row.__getattribute__('My Value')
What solved it:
row["My Value"]
But I'm wondering if there's an official way recommended by the library. Maybe adding a warning in the documentation would be good, in case you access columns with the same name as a reserved attribute.