You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by GitBox <gi...@apache.org> on 2018/01/14 17:01:06 UTC
[GitHub] arpa007 commented on issue #4210: Error Fetching Data: Shape of passed values is (1, 100), indices imply (28, 100)
arpa007 commented on issue #4210: Error Fetching Data: Shape of passed values is (1, 100), indices imply (28, 100)
URL: https://github.com/apache/incubator-superset/issues/4210#issuecomment-357525677
something weird for sure is going on in sql_lab.py:226
i had a bit of my code snippet in here:
222 column_names = (
223 [col[0] for col in cursor_description] if cursor_description else [])
224 column_names = dedup(column_names)
225
226 mydata = pd.DataFrame(data, columns=column_names)
227 logging.info(mydata)
228
229 cdf = dataframe.SupersetDataFrame(
230 pd.DataFrame(list(data)), columns=column_names)
and sure enough the problem is now with mydata. for whatever reason pandas DataFrame seems to be having a problem with the data.
Surprisingly, when I use hard coded data everything works magically:
mydata = [(24, 2), (26, 3), (26, 9), (1081, 2), (1357, 10), (1783, 2), (1784, 2), (1785, 2), (1786, 2), (1788, 2), (1789, 2), (1790, 2), (1792, 2), (1801, 2), (1803, 2), (1804, 2), (1805, 2), (1806, 2), (1813, 2), (1814, 2), (1821, 2), (1822, 2), (1823, 2), (1824, 2), (1832, 2), (1834, 2), (1835, 2), (1836, 2), (1837, 2), (1838, 2), (1839, 2), (1841, 2), (1844, 2), (1845, 2), (1847, 2), (1848, 2), (1849, 2), (1850, 2), (1863, 2), (1864, 2), (1865, 2), (1866, 2), (1882, 2), (1883, 2), (1900, 2), (1911, 2), (1925, 2), (1992, 2), (2006, 2), (2038, 2), (2040, 2), (2056, 2), (2059, 2), (2071, 2), (2081, 2), (2102, 2), (2147, 2), (2161, 2), (2170, 2), (2179, 2), (2189, 2), (2200, 2), (2221, 2), (2244, 2), (2245, 2), (2246, 2), (3081, 10), (4278, 3), (4281, 4), (4282, 4), (4284, 1), (4326, 2), (4364, 2), (4372, 2), (4376, 2), (4407, 2), (4429, 2), (4435, 2), (4443, 2), (4447, 2), (4448, 2), (4465, 2), (4480, 2), (4488, 2), (4515, 2), (4527, 2), (4557, 2), (4585, 2), (4595, 2), (4624, 2),
(4677, 2), (4679, 2), (4709, 2), (4721, 2), (4730, 2), (4758, 2), (4760, 2), (4772, 2), (4785, 2), (4790, 2)]
227
228 mydata = pd.DataFrame(mydata, columns=column_names)
229 logging.info(mydata)
Not sure what really is going in.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services