For some reason I get the following error when creating the class below. However, I don\'t get this error when I run the run_query as a standalone function without creating