INCATools / INCATools/ontology-access-kit

Chore: Getting SADeprecationWarning in SQL code

Open
#861 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
198
Forks
35
Avg merge
3d 4h
Merged PRs (30d)
1

Description

https://github.com/INCATools/ontology-access-kit/blob/cfc88e1cc86d4eff98fc1ab543887792c197597b/src/oaklib/implementations/sqldb/sql_implementation.py#L2659

The above line raises an error when called.

SADeprecationWarning: DISTINCT ON is currently supported only by the PostgreSQL dialect. Use of DISTINCT ON for other backends is currently silently ignored, however this usage is deprecated, and will raise CompileError in a future release for all backends that do not support this syntax.

This is a SQLAlchemy issue, it looks like we need to change part of how the query string is generated using an engine, https://github.com/sqlalchemy/sqlalchemy/discussions/7899#discussioncomment-2501872

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/oaklib/implementations/sqldb/sql_implementation.py at line 2659 and reproduce the call that emits the SADeprecationWarning. Read the linked SQLAlchemy discussion while tracing how the query string is generated with an engine. Done means the query no longer raises this warning for the affected backend.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlalchemy
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.