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

Type Error when trying to recreate the database #576

Open
SherelynA opened this issue Feb 7, 2025 · 4 comments
Open

Type Error when trying to recreate the database #576

SherelynA opened this issue Feb 7, 2025 · 4 comments
Assignees

Comments

@SherelynA
Copy link
Collaborator

I am trying to do the second step of the simple setup however when I run from simple.schema import *, I get the following error message:

from simple.schema import * Traceback (most recent call last): File "/Users/sherelynalejandro/opt/anaconda3/envs/simple-db/lib/python3.11/site-packages/IPython/core/interactiveshell.py", line 3579, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-4-4330bbdb30e3>", line 1, in <module> from simple.schema import * File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sherelynalejandro/PycharmProjects/SIMPLE-db/simple/schema.py", line 468, in <module> ParallaxView = view( ^^^^^ File "/Users/sherelynalejandro/opt/anaconda3/envs/simple-db/lib/python3.11/site-packages/astrodbkit/views.py", line 50, in view t._columns._populate_separate_keys(col._make_proxy(t) for col in selectable.selected_columns) File "/Users/sherelynalejandro/opt/anaconda3/envs/simple-db/lib/python3.11/site-packages/sqlalchemy/sql/base.py", line 1973, in _populate_separate_keys cols = list(iter_) ^^^^^^^^^^^ File "/Users/sherelynalejandro/opt/anaconda3/envs/simple-db/lib/python3.11/site-packages/astrodbkit/views.py", line 50, in <genexpr> t._columns._populate_separate_keys(col._make_proxy(t) for col in selectable.selected_columns) ^^^^^^^^^^^^^^^^^^ TypeError: Label._make_proxy() missing 2 required keyword-only arguments: 'primary_key' and 'foreign_keys'

Any thoughts on what could be causing this?

@kelle
Copy link
Collaborator

kelle commented Feb 7, 2025

Sherelyn, please confirm that your SIMPLE repo is up-to-date and which version of astrodbkit you are running.

@dr-rodriguez dr-rodriguez self-assigned this Feb 10, 2025
@dr-rodriguez
Copy link
Collaborator

Confirmed I can replicate this error when running on Codespaces (ie, a fresh install). I'll see if I can debug it.

@dr-rodriguez
Copy link
Collaborator

SQLAlchemy just had a new version, 2.0.38 4 days ago and updated their documentation on how to handle views 3 days ago. So grabbing the latest SQLAlchemy breaks this and AstrodbKit.

This is fixed with astrodbtoolkit/AstrodbKit#89 which will lead to a new astrodbkit version to use (with the version of SQLAlchemy pinned to avoid this in the future)

@dr-rodriguez
Copy link
Collaborator

OK, this is fixed now. You'll want to do pip install --upgrade astrodbkit and ensure you are running the latest version (2.2)

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

3 participants