facebook / facebook/pyrefly

warn about default and default_factory

Open
#3,264 0 comments 0 reactions 0 assignees View on GitHub
sqlalchemy typechecking
Dominant language
Rust
Stars
7k
Forks
516
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

sqlalchemy will warn about use default= with a function

```py
import sqlalchemy as sa
class F(Base):
idx: Mapped[str] = mapped_column(sa.String, default=lambda: "1")
```

will suggest to use default_factory.

maybe this also can give dataclass?

### Sandbox Link

_No response_

### (Only applicable for extension issues) IDE Information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.