dedupeio / dedupe-examples

:id: Examples for using the dedupe library
MIT License
404 stars 216 forks source link

Code failing while trying to access the same column more than once #98

Closed avaish92 closed 4 years ago

avaish92 commented 4 years ago

Hello,

this is my code sample:

while ibm_db.fetch_row(selectStmt) != False: print(datetime.now().strftime('%Y-%m-%d:%H:%M:%S.%f'), ":[INFO]:fileIngestion.py:Processing file name:", ibm_db.result(selectStmt, 1)) msgId = ibm_db.result(selectStmt, 0) print(msgId) print(ibm_db.result(selectStmt, 1)) print(ibm_db.result(selectStmt, 2)) print(ibm_db.result(selectStmt, 3)) print(ibm_db.result(selectStmt, 3)) print("four:",str(ibm_db.result(selectStmt, 4))) print("four:", str(ibm_db.result(selectStmt, 5))) print(ibm_db.result(selectStmt, 5))

when I am trying to access the same column more than once, via the function ibm_db.result(), the code fails with error Traceback (most recent call last): File "/data/scripts/mainframe/fileIngestion_new.py", line 847, in main(sub_id, event_id) File "/data/scripts/mainframe/fileIngestion_new.py", line 734, in main print(ibm_db.result(selectStmt, 1)) SystemError: Negative size passed to PyUnicode_New It works totally fine if I assign it to variable and use it again and again. I am not able to figure out what the issue is.

avaish92 commented 4 years ago

Here is a more detailed output which the code produces, when the column values are retrieved. Processing file name: UNTEDW.NA.DEV.XEDW265.TERPRDCX.G1610V00

f23232sdsdsd
UNTEDW.NA.DEV.XEDW265.TERPRDCX.G1610V00
2019-09-14:05:46:52.661502 :[ERROR]:fileIngestion.py:Unexcepted error raised in the main block aborting the script....please rerun after resolving the issue
Traceback (most recent call last):
  File "/data/scripts/mainframe/fileIngestion_new.py", line 847, in <module>
    main(sub_id, event_id)
  File "/data/scripts/mainframe/fileIngestion_new.py", line 734, in main
    print(ibm_db.result(selectStmt, 1))
SystemError: Negative size passed to PyUnicode_New
fgregg commented 4 years ago

there does not seem to be any dedupe code in here.