0 votes
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) | 166 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,,,,

^ 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

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.1k 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
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.

421 questions

437 answers


640 users

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