Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load_table doesn't allow single series to be uploaded #217

Open
randyzwitch opened this issue Apr 21, 2019 · 0 comments
Open

load_table doesn't allow single series to be uploaded #217

randyzwitch opened this issue Apr 21, 2019 · 0 comments

Comments

@randyzwitch
Copy link
Contributor

In our code, we don't check for pd.Series, which leads to an awkward error on load:

df_in["text_"]
Out[14]: 
0       EXOjLrekhi
1       rgHt1G78el
2       f35XdnzI7w
3       bd5roUesjg
4       Br6mRzNJBK
5       aplZmLcXgN
6       4PHpJwQULz
7       tNaIoRXsgt
8       viYX5V7unA
9       9ntpty6SMv
10      yLQCKaA1Zc
11      78rKbkR8Zx
12      RvGFrKVxRA
13      7TyVy0yQy3
14      7jfZZnuxVr
15      jj07LXMDB8
16      lnJK3AiXlg
17      CtNnaReNXf
18      Q5lZUwZatR
19      zdxlF4Poh7
20      NRBcZFh28m
21      GEknC1BWRq
22      B143VQEIVa
23      zc3953dsfY
24      lKoZlx0tb2
25      Ow9CQsMca0
26      idhrzZaeyU
27      6MI5uP1dCQ
28      VrDZAqR5w0
29      arzw7tDPEd
   
9970    VvO4ZDBTSB
9971    s3bLBWzM4E
9972    tVwxdjcfaK
9973    U3kpawCgGV
9974    0u5X58nZ2r
9975    jXCi23u5XI
9976    MjFSpr5qvM
9977    ktTPSXlcGc
9978    hIJmiTYvP3
9979    SUdkoKLu2v
9980    cIRnTXFqDv
9981    m4eO46ISEP
9982    ckNd20yXAj
9983    5pNoI9wG2E
9984    crUNMcIzbX
9985    ka9VZsX597
9986    cqlyG83SBy
9987    1QD2gOApM3
9988    TISxpu1ZS8
9989    YWIQuTOcMk
9990    5wnljquyde
9991    fiVI6Ce9fG
9992    KHU2bE8gAV
9993    QabqCtYhkg
9994    4PZf80AWXe
9995    dzrBfDRW3x
9996    A3bT9VnnVx
9997    iTJc6Lh5IR
9998    U0tnRiDEdQ
9999    zV9bcdFDE0
Name: text_, Length: 10000, dtype: object

con.load_table("test_text_no_encoding", df_in["text_"], method='rows')
Traceback (most recent call last):

  File "<ipython-input-15-46ac93a8bf31>", line 1, in <module>
    con.load_table("test_text_no_encoding", df_in["text_"], method='rows')

  File "/home/rzwitch/github_work/pymapd/pymapd/connection.py", line 501, in load_table
    self._client.load_table(self._session, table_name, input_data)

  File "/home/rzwitch/github_work/pymapd/mapd/MapD.py", line 2475, in load_table
    self.recv_load_table()

  File "/home/rzwitch/github_work/pymapd/mapd/MapD.py", line 2499, in recv_load_table
    raise result.e

TMapDException: TMapDException(error_msg='Wrong number of columns to load into Table test_text_no_encoding (10 vs 2)')

Wrapping code in the following allows for result to work:
con.load_table("test_text_no_encoding", pd.DataFrame(df_in["text_"]), method='rows')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant