lablup / backend.ai

Backend.AI is a streamlined, container-based computing cluster platform that hosts popular computing/ML frameworks and diverse programming languages, with pluggable heterogeneous accelerator support including CUDA GPU, ROCm GPU, TPU, IPU and other NPUs.
https://www.backend.ai
GNU Lesser General Public License v3.0
518 stars 153 forks source link

Upgrade to SQLAlchemy v2.0 #1812

Open achimnol opened 10 months ago

achimnol commented 10 months ago

SQLAlchemy v1.4 is a bridge release to migrate v2.0 with introduction of asyncio-native ORM. It's been almost one year since the first release of v2.0 and I think it should have less hassles of the early versions. Our codebase already follows the most of best practices for migration to v2.0.

Let's migrate to v2.0 in favor of better type annotation support.

### Tasks
- [ ] [Apply `__allow_unmapped__ = True` to explicitly typed ORM models](https://docs.sqlalchemy.org/en/20/changelog/migration_20.html#migration-to-2-0-step-six-add-allow-unmapped-to-explicitly-typed-orm-models)
- [ ] Replace all `select([])` patterns to `select()` patterns
- [ ] In query results, replace codes that get the field value by key-name with codes that get the field value by an attribute. (from `row["name"]` to `row.name`)
achimnol commented 7 months ago

Let's revisit this issue.

Yaminyam commented 7 months ago

I will also join in on this issue.