facebook / facebook/pyrefly

field without a default may not follow dataclass field with a default not work on sqlalchemy

Open
#3,263 1 comment 0 reactions 0 assignees View on GitHub
needs-discussion sqlalchemy
Dominant language
Rust
Stars
7k
Forks
516
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

dataclass has this check

```py
from dataclasses import dataclass, field

@dataclass
class F:
idx: int = field(default=1)
another: int
```

Dataclass field `another` without a default may not follow dataclass field with a default [[bad-class-definition](https://pyrefly.org/en/docs/error-kinds/#bad-class-definition)]

but sqlalchemy not

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

### 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.