Orange Forum • View topic - MySQL Datime Field

MySQL Datime Field

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.

MySQL Datime Field

Postby xidobix » Fri Sep 04, 2009 9:07

I am new to orange. I just installed orange and wanted to make a few queries with orngMySQL. I tried with some tables without problems, but when i tried with tables with mysql datetimefield it throws:

Code: Select all
In [15]: data = t.query("SELECT when FROM event_event")
cannot convert SQL values of type 'DATETIME' to OrangeTraceback (most recent call last)

/home/user/orange-trunk/orange/<ipython console> in <module>()

/home/user/orange-trunk/orange/ in query(self, statement, use)
    257             cursor3.close
    258         else:
--> 259             raise "cannot convert SQL values of type '%s' to Orange" % attr_type
    261         names.append(pdAttrName + "#" + attrName)

cannot convert SQL values of type 'DATETIME' to Orange: None

I also searched on this site and it says (
STRING and DATETIME attributes are converted to Orange strings

?? Is this a BUG ?

UPDATE: Here is a dump of my database using python-mysqldb directly:
Code: Select all
In [8]: sql = "SELECT * FROM event_event"
In [9]: cursor.execute(sql)
Out[9]: 3L
In [10]: res = cursor.fetchall()
In [11]: for x in res:
   ....:     print x
(1L, 'lorem', 'lorem', datetime.datetime(2009, 9, 3, 0, 30, 55), 'ipsum', 'flyer/flyer_.jpg', '', 'lorem, ipsum, solem', 1L, 'Ahi mismo', datetime.datetime(2009, 9, 10, 12, 0), 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobi', '12000', 23L, 0L, 2L)

The strange thing is the datetime value (that's how django Web framework stores datetime values :S )

Return to Bugs