cebel / pyctd

PyCTD is a Python software package to query and analyse data from the CTD database
Apache License 2.0
11 stars 4 forks source link

Error on update() #28

Open benjaminrholmes opened 2 years ago

benjaminrholmes commented 2 years ago

I am getting an error when trying to do an initial update using the PyCTD package with MySQL WorkBench.

Here is my python code below:

import pyctd sqlalchemy_connection_string = 'mysql+pymysql://user:password@localhost/pyctd' (the connection works, this is just generic for security) pyctd.update(sqlalchemy_connection_string)

This is the error code I am getting after running the python above:

Traceback (most recent call last): File "C:\Users\benrh\AppData\Local\Programs\Python\Python310\lib\code.py", line 90, in runcode exec(code, self.locals) File "", line 1, in File "C:\Program Files\JetBrains\PyCharm 2021.3.2\plugins\python\helpers\pydev_pydev_bundle\pydev_umd.py", line 198, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "C:\Program Files\JetBrains\PyCharm 2021.3.2\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "C:/Users/benrh/PycharmProjects/devina_web/ctd_queries.py", line 10, in pyctd.update(sqlalchemy_connection_string) File "C:\Users\benrh\PycharmProjects\devina_web\venv\lib\site-packages\pyctd\manager\database.py", line 453, in update db.db_import(urls=urls, force_download=force_download) File "C:\Users\benrh\PycharmProjects\devina_web\venv\lib\site-packages\pyctd\manager\database.py", line 179, in db_import self.import_tables() File "C:\Users\benrh\PycharmProjects\devina_web\venv\lib\site-packages\pyctd\manager\database.py", line 235, in import_tables self.import_table(table) File "C:\Users\benrh\PycharmProjects\devina_web\venv\lib\site-packages\pyctd\manager\database.py", line 291, in import_table self.import_table_in_db(file_path, use_columns_with_index, column_names_in_db, table) File "C:\Users\benrh\PycharmProjects\devina_web\venv\lib\site-packages\pyctd\manager\database.py", line 375, in import_table_in_db for chunk in chunks: File "C:\Users\benrh\PycharmProjects\devina_web\venv\lib\site-packages\pandas\io\parsers\readers.py", line 1187, in next return self.get_chunk() File "C:\Users\benrh\PycharmProjects\devina_web\venv\lib\site-packages\pandas\io\parsers\readers.py", line 1280, in get_chunk return self.read(nrows=size) File "C:\Users\benrh\PycharmProjects\devina_web\venv\lib\site-packages\pandas\io\parsers\readers.py", line 1250, in read index, columns, col_dict = self._engine.read(nrows) File "C:\Users\benrh\PycharmProjects\devina_web\venv\lib\site-packages\pandas\io\parsers\c_parser_wrapper.py", line 225, in read chunks = self._reader.read_low_memory(nrows) File "pandas_libs\parsers.pyx", line 817, in pandas._libs.parsers.TextReader.read_low_memory File "pandas_libs\parsers.pyx", line 861, in pandas._libs.parsers.TextReader._read_rows File "pandas_libs\parsers.pyx", line 847, in pandas._libs.parsers.TextReader._tokenize_rows File "pandas_libs\parsers.pyx", line 1952, in pandas._libs.parsers.raise_parser_error File "C:\Users\benrh\AppData\Local\Programs\Python\Python310\lib_compression.py", line 68, in readinto data = self.read(len(byte_view)) File "C:\Users\benrh\AppData\Local\Programs\Python\Python310\lib\gzip.py", line 507, in read raise EOFError("Compressed file ended before the " EOFError: Compressed file ended before the end-of-stream marker was reached

I know that the connect is working because it populates all 33 tables within my MySQL database, however none of the actual data (table rows) are present.

If anyone has anything that may point me in the right direction to solving this issue I would greatly appreciate it.

Cheers