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

Disable sqlmodel warning #166

Open
khoroshevskyi opened this issue Feb 29, 2024 · 4 comments
Open

Disable sqlmodel warning #166

khoroshevskyi opened this issue Feb 29, 2024 · 4 comments
Assignees
Labels
priority-low wontfix This will not be worked on

Comments

@khoroshevskyi
Copy link
Member

Right now, whenever you want to report a result, sqlmodel raises warning, that sais this table is already created. Shouldn't it be disabled?
https://stackoverflow.com/questions/14463277/how-to-disable-python-warnings

@khoroshevskyi khoroshevskyi added the question Further information is requested label Feb 29, 2024
@donaldcampbelljr
Copy link
Contributor

Can you show the example output?

@khoroshevskyi
Copy link
Member Author

khoroshevskyi commented Mar 4, 2024

image

/home/bnt4me/virginia/venv/bbuploader/lib/python3.10/site-packages/sqlmodel/main.py:549: SAWarning: This declarative base already contains a class with the same class name and module name as pipestat.backends.db_backend.db_parsed_schema.bedfile__sample, and will be replaced in the string-lookup table.
  DeclarativeMeta.__init__(cls, classname, bases, dict_, **kw)
[WARNING] [17:10:52] [PIPESTAT] Initialize PipestatBackend
[WARNING] [17:10:52] [PIPESTAT] Initializing DBBackend for pipeline 'bedsets'

@nsheff nsheff added this to the v0.9.0 milestone Mar 12, 2024
@nsheff nsheff added this to PEP Mar 12, 2024
@donaldcampbelljr
Copy link
Contributor

We solved this for the test suite by placing the tests within context managers. (See: #48)
However, this warning will still occur in normal usage if creating a model with an existing name.

We are appropriately setting extend_existing=True but this only allows us to create the model. It will still warn the user.

I'm not convinced that filtering all warnings is the correct way to proceed.

Perhaps we could load a model from an existing table? Via object reflection? https://docs.sqlalchemy.org/en/20/core/reflection.html

@donaldcampbelljr
Copy link
Contributor

Per discussion, assigning this to Alex and I'm moving this to another milestone as it should not hold up 0.9.0.

@donaldcampbelljr donaldcampbelljr modified the milestones: v0.9.0, v0.10.0 Apr 17, 2024
@donaldcampbelljr donaldcampbelljr added wontfix This will not be worked on and removed question Further information is requested labels Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-low wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants