Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError in database Space table. #23

Open
Bacoknight opened this issue Jan 1, 2019 · 0 comments
Open

TypeError in database Space table. #23

Bacoknight opened this issue Jan 1, 2019 · 0 comments

Comments

@Bacoknight
Copy link

I've had no issue in accessing a database that I generated on my personal computer. However, I have attempted to run the same python script on a distributed Linux network and the Space table entry seems to be a bunch of text rather than the usually BLOB binary that I've noticed on my local computer. When I try to transfer the database file onto my personal computer, trying to access the data to obtain the 'translated' variables returns the following error:


Traceback (most recent call last):
  File "c:\Users\USER\.vscode\extensions\ms-python.python-2018.12.1\pythonFiles\ptvsd_launcher.py", line 45, in <module>
    main(ptvsdArgs)
  File "c:\Users\USER\.vscode\extensions\ms-python.python-2018.12.1\pythonFiles\lib\python\ptvsd\__main__.py", line 265, in main
    wait=args.wait)
  File "c:\Users\USER\.vscode\extensions\ms-python.python-2018.12.1\pythonFiles\lib\python\ptvsd\__main__.py", line 256, in handle_args
    run_main(addr, name, kind, *extra, **kwargs)
  File "c:\Users\USER\.vscode\extensions\ms-python.python-2018.12.1\pythonFiles\lib\python\ptvsd\_local.py", line 52, in run_main
    runner(addr, name, kind == 'module', *extra, **kwargs)
  File "c:\Users\USER\.vscode\extensions\ms-python.python-2018.12.1\pythonFiles\lib\python\ptvsd\runner.py", line 32, in run
    set_trace=False)
  File "c:\Users\USER\.vscode\extensions\ms-python.python-2018.12.1\pythonFiles\lib\python\ptvsd\_vendored\pydevd\pydevd.py", line 1283, in run
    return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
  File "c:\Users\USER\.vscode\extensions\ms-python.python-2018.12.1\pythonFiles\lib\python\ptvsd\_vendored\pydevd\pydevd.py", line 1290, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "c:\Users\USER\.vscode\extensions\ms-python.python-2018.12.1\pythonFiles\lib\python\ptvsd\_vendored\pydevd\_pydev_imps\_pydev_execfile.py", line 25, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "c:\Users\USER\Desktop\Work Related Items\database_reader.py", line 44, in <module>
    ConfirmF(choco.SQLiteConnection("sqlite:///1.db"))
  File "c:\Users\USER\Desktop\Work Related Items\database_reader.py", line 32, in ConfirmF
    bestDict = GetBest5Results(databaseConnection, False)
  File "c:\Users\USER\Desktop\Work Related Items\database_reader.py", line 19, in GetBest5Results
    resultsTable = databaseConnection.results_as_dataframe()
  File "C:\Users\USER\Anaconda3\lib\site-packages\chocolate\base.py", line 60, in results_as_dataframe
    s = self.get_space()
  File "C:\Users\USER\Anaconda3\lib\site-packages\chocolate\connection\sqlite.py", line 189, in get_space
    return pickle.loads(db[self.space_table_name].find_one()["space"])
TypeError: a bytes-like object is required, not 'str'

I think I've managed to alleviate the issue by exporting the Space table from the database created by the script running on my personal computer and importing this on the other database, but the variables returned by this don't give the same loss value as the database suggests which is concerning.

Is there any way to prevent the Space table being generated as plain text, but as a BLOB binary as it's meant to? Additionally, if two problems have the same bounds for the same variables, are their Space tables interchangable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant