Skip to content

Auto-complete for SQLAlchemy isn't working in VS Code (Pyrefly 1.4.1) #5657

Todo

Description

@Desalutar20

Describe the Bug

2026-11-15.10-43-45.mp4

The problem is with pyrefly because I changed the extension to ty and the tips started working.

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

Visual Studio Code
Pyrefly 1.4.1

Activity

  1. added
    language-server
    on Nov 19, 2026
  2. added theissue type on Nov 19, 2026
  3. added
    sqlalchemy
    on Nov 19, 2026
  4. shahhamdihassan commented on Nov 19, 2026

    @shahhamdihassan
    Contributor

    Thanks for the report and the video! Could you paste a small code sample (the model definition and the line where completion stops working) and your SQLAlchemy version, so we can reproduce it?

  5. Desalutar20 commented on Nov 20, 2026

    @Desalutar20
    Author
    from datetime import datetime
    from uuid import UUID
    
    from sqlalchemy import CheckConstraint, DateTime, String
    from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
    from sqlalchemy.sql import text
    
    
    class Model(DeclarativeBase):
        __abstract__ = True
        id: Mapped[UUID] = mapped_column(primary_key=True)
        created_at: Mapped[datetime] = mapped_column(
            DateTime(timezone=True), nullable=False
        )
        updated_at: Mapped[datetime] = mapped_column(
            DateTime(timezone=True), nullable=False
        )
    
    
    class User(Model):
        __tablename__ = "users"
        __table_args__ = (
            CheckConstraint(
                "role IN ('admin', 'regular')",
                name="ck_users_role",
            ),
        )
    
        email: Mapped[str] = mapped_column(
            String(200), unique=True, nullable=False
        )
        password_hash: Mapped[str | None] = mapped_column(
            String(200), nullable=True
        )
        password_salt: Mapped[bytes | None] = mapped_column(nullable=True)
        first_name: Mapped[str | None] = mapped_column(
            String(50), nullable=True
        )
        last_name: Mapped[str | None] = mapped_column(
            String(50), nullable=True
        )
        role: Mapped[str] = mapped_column(server_default="regular", nullable=False)
        is_banned: Mapped[bool] = mapped_column(
            server_default=text("false"), nullable=False
        )
        is_verified: Mapped[bool] = mapped_column(
            server_default=text("false"), nullable=False
        )
        avatar_url: Mapped[str | None] = mapped_column(
            String(2000), nullable=True
        )
        github_id: Mapped[str | None] = mapped_column(
            String(200), nullable=True
        )
        google_id: Mapped[str | None] = mapped_column(
            String(200), nullable=True
        )
    image
  6. shahhamdihassan commented on Nov 24, 2026

    @shahhamdihassan
    Contributor

    Thanks for the code sample! That gives us what we need to reproduce it. We'll take a look and follow up here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

language-serversqlalchemy

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions