njcuk9999 / apero-drs

A PipelinE to Reduce Observations - The DRS for SPIRou (CFHT)
MIT License
12 stars 1 forks source link

0.7.290 objdb 'SQL syntax error' with apero_astrometrics.py #786

Open larnoldgithub opened 1 month ago

larnoldgithub commented 1 month ago

@njcuk9999 This target is already in the obsdb, but I got a 'SQP syntax error' when I checked this star. see below.

This is a brand new up to date install of the 290. I have already successfully entered new objects before checking this VV Cra object.


apero_astrometrics.py 'VV Cra' --nopmrequired

03:31:00.399-  |ASTROM| ***************************************************************************
03:31:00.404-  |ASTROM| *
03:31:00.404-  |ASTROM| *  SPIROU @PID-00017284446598899670-TKGN (V0.7.290)
03:31:00.404-  |ASTROM| *         py3.9.20  git:v0.7.290-stable-test
03:31:00.404-  |ASTROM| *
03:31:00.408-  |ASTROM| ***************************************************************************
03:31:00.412-  |ASTROM|           █████╗ ██████╗ ███████╗██████╗  ██████╗  
03:31:00.416-  |ASTROM|          ██╔══██╗██╔══██╗██╔════╝██╔══██╗██╔═══██╗ 
03:31:00.421-  |ASTROM|          ███████║██████╔╝█████╗  ██████╔╝██║   ██║ 
03:31:00.425-  |ASTROM|          ██╔══██║██╔═══╝ ██╔══╝  ██╔══██╗██║   ██║ 
03:31:00.429-  |ASTROM|          ██║  ██║██║     ███████╗██║  ██║╚██████╔╝ 
03:31:00.433-  |ASTROM|          ╚═╝  ╚═╝╚═╝     ╚══════╝╚═╝  ╚═╝ ╚═════╝  
03:31:00.437-  |ASTROM| ***************************************************************************
03:31:00.444-**|ASTROM| DRS Setup:
03:31:00.448-**|ASTROM| 
03:31:00.448-**|ASTROM|         DRS_ROOT: /opt/apero-drs/apero
03:31:00.448-**|ASTROM|         DRS_DATA_RAW: /apero-data/test_helu/raw
03:31:00.448-**|ASTROM|         DRS_DATA_REDUC: /apero-data/test_helu/red
03:31:00.448-**|ASTROM|         DRS_DATA_WORKING: /apero-data/test_helu/tmp
03:31:00.448-**|ASTROM|         DRS_CALIB_DB: /apero-data/test_helu/calib
03:31:00.449-**|ASTROM|         DRS_TELLU_DB: /apero-data/test_helu/tellu
03:31:00.449-**|ASTROM|         DRS_DATA_ASSETS: /apero-data/test_helu/asset
03:31:00.449-**|ASTROM|         DRS_DATA_OUT: /apero-data/test_helu/out
03:31:00.449-**|ASTROM|         DRS_DATA_MSG: /apero-data/test_helu/log
03:31:00.449-**|ASTROM|         DRS_DATA_RUN: /apero-data/test_helu/run
03:31:00.449-**|ASTROM|         DRS_DATA_PLOT: /apero-data/test_helu/plot
03:31:00.449-**|ASTROM|         DRS_DATA_OTHER: /apero-data/test_helu/other
03:31:00.449-**|ASTROM|         LBL_PATH: /apero-data/test_helu/lbl
03:31:00.449-**|ASTROM|         DRS_CONFIG: /opt/apero-drs/config/test_helu/user_config.ini
03:31:00.449-**|ASTROM|         DRS_CONFIG: /opt/apero-drs/config/test_helu/user_constants.ini
03:31:00.450-**|ASTROM|         DRS_CONFIG: apero.constants.default.default_config
03:31:00.450-**|ASTROM|         DRS_CONFIG: apero.constants.default.default_keywords
03:31:00.450-**|ASTROM|         DRS_CONFIG: config.instruments.spirou.default_config.py
03:31:00.450-**|ASTROM|         DRS_CONFIG: config.instruments.spirou.default_keywords.py
03:31:00.450-**|ASTROM|         DRS_CONFIG: core.instruments.default.default_constants.py
03:31:00.450-**|ASTROM|         DRS_CONFIG: core.instruments.spirou.default_constants.py
03:31:00.450-**|ASTROM|         DATABASE: MYSQL
03:31:00.450-**|ASTROM|         DATABASE-calib: spirou@pupus-mysql:calib_test_helu_db
03:31:00.450-**|ASTROM|         DATABASE-tellu: spirou@pupus-mysql:tellu_test_helu_db
03:31:00.450-**|ASTROM|         DATABASE-findex: spirou@pupus-mysql:findex_test_helu_db
03:31:00.450-**|ASTROM|         DATABASE-log: spirou@pupus-mysql:log_test_helu_db
03:31:00.450-**|ASTROM|         DATABASE-astrom: spirou@pupus-mysql:astrom_test_helu_db
03:31:00.451-**|ASTROM|         DATABASE-lang: spirou@pupus-mysql:lang_test_helu_db
03:31:00.451-**|ASTROM|         DATABASE-reject: spirou@pupus-mysql:reject_test_helu_db
03:31:00.451-**|ASTROM|         PRINT_LEVEL: all
03:31:00.451-**|ASTROM|         LOG_LEVEL: all
03:31:00.451-**|ASTROM|         DRS_PLOT: 0
03:31:00.455-  |ASTROM| ***************************************************************************
03:31:00.459-**|ASTROM| Arguments used:
03:31:00.463-**|ASTROM| 
03:31:00.463-**|ASTROM|         --OBJECTS: VV Cra
03:31:00.464-**|ASTROM|         --NOPMREQUIRED: True
03:31:00.468-  |ASTROM| ***************************************************************************
03:31:01.116-  |ASTROM| Updating object database (from google sheets)
03:31:06.465-  |ASTROM| Searching local object database for object names...
03:31:06.928-  |ASTROM|          - Object: "VV Cra" found in database as "VV_CRA"
03:31:06.960-**|ASTROM| Accessing full local object database...
03:31:07.018-**|ASTROM| Checking object VV Cra for errors.
03:31:07.057-!!|ASTROM| 03:31:07.049-**|DatabaseError|E[00-002-00032] <class
03:31:07.057-!!|ASTROM|         'mysql.connector.errors.ProgrammingError'>: 1064 (42000): You have an error in
03:31:07.057-!!|ASTROM|         your SQL syntax; check the manual that corresponds to your MariaDB server
03:31:07.057-!!|ASTROM|         version for the right syntax to use near 'VV CrA NE"" OR KW_OBJNAME=""VV CrA
03:31:07.057-!!|ASTROM|         SW"" OR KW_OBJNAME="UCAC216068379" OR KW_O...' at line 1
03:31:07.057-!!|ASTROM| Command: SELECT DISTINCT KW_OBJNAME FROM findex_test_helu_db WHERE
03:31:07.057-!!|ASTROM|         KW_OBJNAME="VV_CRA" OR KW_OBJNAME="VV CrA" OR KW_OBJNAME="UCAC2 16068379" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="** REP 48" OR KW_OBJNAME="AP J19030674-3712494" OR KW_OBJNAME="DENIS
03:31:07.057-!!|ASTROM|         J190306.7-371249" OR KW_OBJNAME="HBC 291" OR KW_OBJNAME="Hen 3-1736" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="HGBS J190307.0-371250" OR KW_OBJNAME="IRAS 18597-3717" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="JCMTSE J190306.9-371248" OR KW_OBJNAME="JCMTSF J190306.9-371248" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="2MASS J19030674-3712494" OR KW_OBJNAME="NAME VV CrA IRC" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="PSCz P18597-3717" OR KW_OBJNAME="SSTgbs J1903068-371249" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="SV* HV 4000" OR KW_OBJNAME="TIC 254080107" OR KW_OBJNAME="UCAC4
03:31:07.057-!!|ASTROM|         264-177392" OR KW_OBJNAME="V* VV CrA" OR KW_OBJNAME="VSST 4" OR KW_OBJNAME="WDS
03:31:07.057-!!|ASTROM|         J19031-3713AB" OR KW_OBJNAME="WISEA J190306.78-371249.2" OR KW_OBJNAME="WISE
03:31:07.057-!!|ASTROM|         J190306.80-371249.2" OR KW_OBJNAME="[CKR2003] MMS 24" OR KW_OBJNAME="[NWA2005]
03:31:07.057-!!|ASTROM|         SMM 9" OR KW_OBJNAME="[SHK2011b] 4" OR KW_OBJNAME="[WGL92] iras 33" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="Gaia DR3 6719168132036642432" OR KW_OBJNAME="Gaia DR2
03:31:07.057-!!|ASTROM|         6719168132036642432" OR KW_OBJNAME=""VV CrA NE"" OR KW_OBJNAME=""VV CrA SW"" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="UCAC216068379" OR KW_OBJNAME="**REP48" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="APJ19030674-3712494" OR KW_OBJNAME="DENISJ190306.7-371249" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="HBC291" OR KW_OBJNAME="Hen3-1736" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="HGBSJ190307.0-371250" OR KW_OBJNAME="IRAS18597-3717" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="JCMTSEJ190306.9-371248" OR KW_OBJNAME="JCMTSFJ190306.9-371248" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="2MASSJ19030674-3712494" OR KW_OBJNAME="NAMEVVCrAIRC" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="PSCzP18597-3717" OR KW_OBJNAME="SSTgbsJ1903068-371249" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="SV*HV4000" OR KW_OBJNAME="TIC254080107" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="UCAC4264-177392" OR KW_OBJNAME="V*VVCrA" OR KW_OBJNAME="VSST4" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="WDSJ19031-3713AB" OR KW_OBJNAME="WISEAJ190306.78-371249.2" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="WISEJ190306.80-371249.2" OR KW_OBJNAME="[CKR2003]MMS24" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="[NWA2005]SMM9" OR KW_OBJNAME="[SHK2011b]4" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="[WGL92]iras33" OR KW_OBJNAME="GaiaDR36719168132036642432" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME="GaiaDR26719168132036642432" OR KW_OBJNAME=""VVCrANE"" OR
03:31:07.057-!!|ASTROM|         KW_OBJNAME=""VVCrASW""
03:31:07.059-!!|ASTROM|         path: /home/spdrs/.apero/spdrs_at_pupus-mysql
03:31:07.060-!!|ASTROM|         Function: apero.base.drs_db.py.Database.execute()
03:31:07.091-**|ASTROM| ***************************************************************************
03:31:07.100-@!|ASTROM| W[40-003-00005]: Recipe apero_astrometrics has NOT been successfully completed
03:31:07.105-**|ASTROM| ***************************************************************************
larnoldgithub commented 1 month ago

It's a binary object, we do have observations for each component, 2" appart.

line 28 and 30 in the pending list currently. I left comment for those two lines in the google sheet.

njcuk9999 commented 1 month ago

So first thing to do is run the query in MySQL:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'VV CrA NE"" OR KW_OBJNAME=""VV CrA SW"" OR
KW_OBJNAME="UCAC216068379" OR KW_O...' at line 9

It seems that SIMBAD is adding an alias with quotations, leading to double quotations which then break the query. I'll patch this in v0.7.291 so that I don't except quotations around aliases.

For the short term: I'll remove those from the alias list and then this should work.

njcuk9999 commented 1 month ago

Okay turns out there were at least 3 targets in the pending list with " in the alias - I've removed these as they will break the SQL query. I'll have to make sure users can't add the " either to make this not be a problem in the future.

larnoldgithub commented 1 month ago

Ok I checked that apero_astrometrics 'VV CrA' now works indeed. Thanks! I'm done in principle with all new targets from 24A I had.