1

Here is how the variables are parsed from the config file :

soc_code = tuple(config.get('MyScript', 'soc_code').split(','))
genre_code = tuple(config.get('MyScript', 'genre_code').split(','))

Here is my sql query :

sql_query = pd.read_sql_query(''' 
SELECT SOC_NAME, GENRE_NAME FROM DATA WHERE SOC_CODE IN %s AND GENRE_CODE IN %s
''' % (genre_code, soc_code) ,conn)

The content of the config file look like this:

soc_code = CODE1, CODE2
genre_codes = GCODE1, GCODE2

I always end up with a formatting error.

JL Peyret
  • 10,917
  • 2
  • 54
  • 73
MDUB77
  • 65
  • 5
  • _I always end up with a formatting error_ Show us the whole error message. – John Gordon Jan 14 '23 at 22:04
  • Traceback (most recent call last): File "/home/user/scripts_prod/from __future__ import print_function.py", line 58, in sql_query = pd.read_sql_query(''' TypeError: not all arguments converted during string formatting – MDUB77 Jan 15 '23 at 10:57

0 Answers0