facebook / facebook/pyrefly

Bug: False positive `bad-argument-count` for PySpark `Column` methods

Open
#3,465 15 comments 1 reaction 1 assignee Claimed by @ANU-2524 View on GitHub
decorators help wanted typechecking
Dominant language
Rust
Stars
7k
Forks
519
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

### Description

Pyrefly incorrectly reports `bad-argument-count` for zero-argument PySpark `Column` methods, claiming each call is missing one positional argument.

### Affected methods

- `.isNull()`
- `.isNotNull()`
- `.asc()`
- `.desc()`
- `.eqNullSafe(other)`

### Example

```python
from pyspark.sql import functions as F

F.col("x").isNull() # ERROR: Expected 1 more positional argument
F.col("x").isNotNull() # ERROR: Expected 1 more positional argument
F.col("x").asc() # ERROR: Expected 1 more positional argument
F.col("x").desc() # ERROR: Expected 1 more positional argument
F.col("x").eqNullSafe(F.col("y")) # ERROR: Expected 1 more positional argument
```

### Expected behavior
No errors. These are valid zero-argument (or single-argument) methods on pyspark.sql.Column.

### Environment
pyrefly: >=1.0.0
pyspark: 3.5.5
preset: legacy

### Workaround

[tool.pyrefly.errors]
bad-argument-count = "ignore"

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