Skip to content

sdssdb v1#295

Merged
albireox merged 48 commits intomainfrom
sdssdb-v1
Feb 5, 2026
Merged

sdssdb v1#295
albireox merged 48 commits intomainfrom
sdssdb-v1

Conversation

@albireox
Copy link
Copy Markdown
Member

@albireox albireox commented Dec 8, 2025

This PR includes changes described in #267 and sub-issues to bring sdssdb to stable development. The main changes includes:

  • Support for SQLA 2.
  • Support for connection pooling with Peewee.
  • Update the style of the documentation and remove outdated text.
  • Increase coverage in tests.
  • Improve Python packaging and linting with uv and ruff.
  • Update GitHub actions and workflows.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 8, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@havok2063
Copy link
Copy Markdown
Collaborator

Oh yeah that's right. Is this only in the new catalogdb schema? I think you can switch to Optional, and that should work. I used Optional in the models following https://docs.sqlalchemy.org/en/20/changelog/whatsnew_20.html#migrating-an-existing-mapping. They use Optional to imply the mapped types so you can reduce fullname: Mapped[Optional[str]] = mapped_column(String) to just fullname: Mapped[Optional[str]]. I don't know if it does that with Mapped[str | None].

@havok2063
Copy link
Copy Markdown
Collaborator

Admittedly, I did not follow their complete guide, because I wanted to a.) finish this work, and b.) keep some readability in the models

@albireox
Copy link
Copy Markdown
Member Author

albireox commented Feb 3, 2026

Yes, actually Optional may work there and be not too painful. Other unions may require changing to Union[A, B] which is a bit ugly but probably ok. I think this happens with any migrated module in sdss5db.

@havok2063
Copy link
Copy Markdown
Collaborator

I also noticed catalogdb has a lot of Mapped[Any]. These should probably be updated to match the actual db column type.

@albireox
Copy link
Copy Markdown
Member Author

albireox commented Feb 3, 2026

Yes, that worked and it was only catalogdb. I also typed most of the Mapped[Any].

@havok2063
Copy link
Copy Markdown
Collaborator

Sounds good. What is left to do in the list for v1? We can also discuss in a breakout on Thursday.

@albireox
Copy link
Copy Markdown
Member Author

albireox commented Feb 3, 2026

Yes, let's discuss it on Thursday but I think we are basically done.

@havok2063 havok2063 requested a review from Copilot February 5, 2026 20:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades sdssdb to version 1.0, including major dependency updates and code style improvements.

Changes:

  • Upgraded SQLAlchemy from 1.x to 2.0 and psycopg2 to psycopg3
  • Updated Python version requirements (3.9-4.0) and migrated build system to uv
  • Standardized code style by converting all string literals from single to double quotes

Reviewed changes

Copilot reviewed 91 out of 96 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Updated version to 1.0.0a1, upgraded dependencies (SQLAlchemy 2.0, psycopg3), migrated to uv build system
python/sdssdb/connection.py Updated SQLAlchemy API calls for 2.0 compatibility (URL.create, future flags)
python/sdssdb/sqlalchemy/sdss5db/init.py Replaced declarative_base with DeclarativeBase for SQLAlchemy 2.0
schema/sdss5db/vizdb/*.py Added new sdss_id_to_astra_pipeline table and helper script
tests/**/*.py Converted string quotes to double quotes throughout test files
.github/workflows/*.yml Updated CI/CD workflows to use uv package manager
docs/sphinx/*.rst Updated documentation for SQLAlchemy 2.0 syntax changes
readthedocs.yml Updated OS version and removed deprecated configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread schema/sdss5db/metadata/vizdb.json Outdated
Comment thread readthedocs.yml Outdated
@havok2063 havok2063 added the enhancement New feature or request label Feb 5, 2026
@albireox
Copy link
Copy Markdown
Member Author

albireox commented Feb 5, 2026

@copilot write a description for this pull request.

Copy link
Copy Markdown

Copilot AI commented Feb 5, 2026

@albireox I've opened a new pull request, #306, to work on those changes. Once the pull request is ready, I'll request review from you.

@albireox albireox merged commit b14bc37 into main Feb 5, 2026
20 checks passed
@albireox albireox deleted the sdssdb-v1 branch February 5, 2026 22:02
@albireox albireox restored the sdssdb-v1 branch February 5, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

5 participants