0 votes
153 views
I have been troubleshooting this for a while, this is my first time using Astro Data Lab. Keep running into this error when trying to upload a table to myDB, any help?
by yashhrajjj (180 points) | 153 views
,ID,Other names,"R.A.(deg)","Decl.(deg)",RA:h,RA:m,RA:s,Dec:d,Dec:m,Dec:s,Legacy URL,m_g,M_g,mu_g,R_e (kpc),R_e (arcsec),Redshift,Distance (Mpc),Nucleated,Class,Environment,Host PGC,Host galaxy,"Spitzer data","HST data",Comments,,,,
1,000033+165423,,0.1392,16.9065,0,0,33.408,16,54,23.4,https://www.legacysurvey.org/viewer?ra=0.1392&dec=16.9065&layer=ls-dr10&zoom=16,18.58,-12.75,24.58,0.52,6.33,9.9999,16.94435859,0,ND,2,218,PGC218,,,,,,,



^ First two lines of my csv file

1 Answer

0 votes
Hi, thanks for reaching out. Good good idea to post a few rows from your CSV.
I suspect it the CSV file formatting. Without having tried out, but some hints / suggestions:

- First character in the header row is a comma --> Not good.
- Are there un-named columns at the end of your table? --> If yes, not good.
- There are some almost-certainly non-permitted characters in the column names, including parentheses, colons, and whitespaces. It's safest to stick to small-caps letters [a-z], digits [0-9], and the underscore character '_'. The first character must not be a digit.
- String-valued entries should be quoted with "double-quotes", e.g. the legacysurvey.org/viewer URLs
- Is "paudel" the name of the table you are assigning? (which is fine) If you have been re-using the same name in several attempts to import the table, it's possible that in an early attempt the table was created, but then the import failed for some reason. That table then might still be hanging around. You can try to drop it first with (for instance in a notebook):

from dl import queryClient as qc
qc.mydb_drop('paudel')

In case you need to login on the NB server first (but only if you aren't logged in already), do also first:

from dl import authClient as ac
from getpass import getpass
token = ac.login(input("Username [+ENTER]:",getpass("Password [+ENTER]:"))

Please let us know if you can not make it work.
by robertdemo (8.0k points)
Thank you for the quick reply and the help! Unfortunately, I tried all of these things and I am still receiving the same error. Here is what the first couple of lines for the csv file look like now. I did try using only lowercase although that did not make a difference so I reverted it to its current state.

num,ID,Other_names,"R.A.","Decl.",RA:h,RA:m,RA:s,Dec:d,Dec:m,Dec:s,"Legacy URL",m_g,M_g,mu_g,R_e,R_e,Redshift,Distance,Nucleated,Class,Environment,Host PGC,host_galaxy,"Spitzer data","HST data",Comments,Legacy_DR10_thumbnails,WISE,GALEX,Hyper_Suprime_Cam
1,000033+165423,,0.1392,16.9065,0,0,33.408,16,54,23.4,https://www.legacysurvey.org/viewer?ra=0.1392&dec=16.9065&layer=ls-dr10&zoom=16,18.58,-12.75,24.58,0.52,6.33,9.9999,16.94435859,0,ND,2,218,PGC218,,,,,,,
2,000044+152725,,0.1855,15.4572,0,0,44.52,15,27,25.92,https://www.legacysurvey.org/viewer?ra=0.1855&dec=15.4572&layer=ls-dr10&zoom=16,19.52,-11.81,26.1,0.68,8.25,9.9999,17.00123475,0,ND,2,218,PGC218,,,,,,,
3,000222+160140,,0.5929,16.0279,0,2,22.296,16,1,40.44,https://www.legacysurvey.org/viewer?ra=0.5929&dec=16.0279&layer=ls-dr10&zoom=16,19.56,-11.77,24.16,0.27,3.31,9.9999,16.8252401,0,ND,2,218,PGC218,,,,,,,
Thanks again for the example. I tried it out now and it was failing. Until I realized that you have identically-named columns  (R_e/R_e, and m_g/M_g). Each column name must be unique. And they will be stored in small-caps, i.e. m_g and M_g are considered identical. When I gave them unique names, the import works fine.
Wow. Works perfect now. Thank you so much! I really appreciate it a lot.

416 questions

434 answers

440 comments

636 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.

Categories