{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/12722","repository_url":"https://api.github.com/repos/pydata/pandas","labels_url":"https://api.github.com/repos/pydata/pandas/issues/12722/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/12722/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/12722/events","html_url":"https://github.com/pydata/pandas/issues/12722","id":143925483,"number":12722,"title":"read_sql from sqlite doesn't work with np datatypes","user":{"login":"pkch","id":1593648,"avatar_url":"https://avatars.githubusercontent.com/u/1593648?v=3","gravatar_id":"","url":"https://api.github.com/users/pkch","html_url":"https://github.com/pkch","followers_url":"https://api.github.com/users/pkch/followers","following_url":"https://api.github.com/users/pkch/following{/other_user}","gists_url":"https://api.github.com/users/pkch/gists{/gist_id}","starred_url":"https://api.github.com/users/pkch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkch/subscriptions","organizations_url":"https://api.github.com/users/pkch/orgs","repos_url":"https://api.github.com/users/pkch/repos","events_url":"https://api.github.com/users/pkch/events{/privacy}","received_events_url":"https://api.github.com/users/pkch/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/Bug","name":"Bug","color":"e10c02"},{"url":"https://api.github.com/repos/pydata/pandas/labels/IO%20SQL","name":"IO SQL","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-28T08:22:43Z","updated_at":"2016-03-29T01:33:26Z","closed_at":null,"body":"#### Code Sample, a copy-pastable example if possible\r\n```\r\nimport sqlite3\r\nimport pandas as pd\r\nconn = sqlite3.connect('tmp')\r\ndf = pd.DataFrame({'a': [0,1,2]})\r\ndf.to_sql('df', conn)\r\npd.read_sql('SELECT * FROM df WHERE a = ?', conn, params=[1]).shape  # (1,2) as expected\r\npd.read_sql('SELECT * FROM df WHERE a = ?', conn, params=[np.int64(1)]).shape # (0, 2) - bug\r\n```\r\n#### Expected Output\r\n(1,2)\r\nActually, it works only with int/float/np.float64, but not with np.int64/np.int32/np.float128/np.float32. \r\nThis of course is a problem when the values are obtained from pandas dataframes, where they are often np.int64.\r\n\r\n#### output of ``pd.show_versions()``\r\n\r\nINSTALLED VERSIONS\r\n------------------\r\ncommit: None\r\npython: 3.5.0.final.0\r\npython-bits: 64\r\nOS: Linux\r\nOS-release: 3.13.0-77-generic\r\nmachine: x86_64\r\nprocessor: x86_64\r\nbyteorder: little\r\nLC_ALL: None\r\nLANG: en_US.UTF-8\r\n\r\npandas: 0.18.0\r\nnose: 1.3.7\r\npip: 8.1.1\r\nsetuptools: 18.2\r\nCython: 0.23.4\r\nnumpy: 1.11.0\r\nscipy: 0.16.1\r\nstatsmodels: 0.6.1\r\nxarray: None\r\nIPython: 4.0.0\r\nsphinx: None\r\npatsy: 0.4.1\r\ndateutil: 2.5.2\r\npytz: 2016.3\r\nblosc: None\r\nbottleneck: 1.0.0\r\ntables: None\r\nnumexpr: 2.4.6\r\nmatplotlib: 1.5.0\r\nopenpyxl: None\r\nxlrd: None\r\nxlwt: None\r\nxlsxwriter: None\r\nlxml: None\r\nbs4: None\r\nhtml5lib: None\r\nhttplib2: None\r\napiclient: None\r\nsqlalchemy: None\r\npymysql: None\r\npsycopg2: None\r\njinja2: 2.8\r\nboto: None"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/202656745","html_url":"https://github.com/pydata/pandas/issues/12722#issuecomment-202656745","issue_url":"https://api.github.com/repos/pydata/pandas/issues/12722","id":202656745,"user":{"login":"pkch","id":1593648,"avatar_url":"https://avatars.githubusercontent.com/u/1593648?v=3","gravatar_id":"","url":"https://api.github.com/users/pkch","html_url":"https://github.com/pkch","followers_url":"https://api.github.com/users/pkch/followers","following_url":"https://api.github.com/users/pkch/following{/other_user}","gists_url":"https://api.github.com/users/pkch/gists{/gist_id}","starred_url":"https://api.github.com/users/pkch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkch/subscriptions","organizations_url":"https://api.github.com/users/pkch/orgs","repos_url":"https://api.github.com/users/pkch/repos","events_url":"https://api.github.com/users/pkch/events{/privacy}","received_events_url":"https://api.github.com/users/pkch/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T01:33:26Z","updated_at":"2016-03-29T01:33:26Z","body":"Well of course I can deal with it, as you suggest (or by simply converting it explicitly, using `int()`). But that's only after I know that it's a problem. How long would it take someone to figure out that this bug is affecting their results? Especially, since there's no error message, just silently producing incorrect result.\r\n\r\nAnd yes, I don't know if it's a bug in `pandas`, or `sqlite3`."}}