Orange Forum • View topic - problem with orngMysql:can't improt the date type items

problem with orngMysql:can't improt the date type items

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

problem with orngMysql:can't improt the date type items

Postby buben » Tue Sep 19, 2006 8:30

when I want to import the data set in mysql into orange, which the data set has some date type variable.there is the following error message:

Unhandled exception of type exceptions.TypeError occured at 16:15:50:

Traceback:

File: orngSignalManager.py in line 60

Function name: __call__

Code: apply(self.method, k)

File: OWDatabaseFile.py in line 72

Function name: select

Code: data = mydb.query(stmt)

File: orngMySQL.py in line 309

Function name: query

Code: example[attrNames[i]] = y

Exception type: exceptions.TypeError

Exception value: cannot convert an object of type 'datetime.date' to value of attribute 'Iissue_date'
_____________________________________________________________

The items of Iissue_date have the form "yyyy-mm-dd". I find one item of Iissue_date is "2002-1-1".Must it be the form "2002-01-01"?

Postby Blaz » Sat Oct 14, 2006 17:45

Attributes of the type ["CHAR", "TEXT", "STRING", "DATE", "TIME", "VARCHAR", "TIMESTAMP", "LONGVARCHAR"] are converted to Orange string attributes, hence what they include in the data table is irrelevant. The warning you are getting is probably due to the attribute type that was not listed in orngMySQL. If you want to include it, edit the line (no. 237)

Code: Select all
elif attr_type in ["CHAR", "TEXT", "STRING", "DATE", "TIME", "VARCHAR", "TIMESTAMP", "LONGVARCHAR"]:


in orngMySql.


Return to Bugs