#12799·wandb

[Bug]: Fabric WandbLogger: include supported None save_dir values in annotations

Author: humdrum00001010Created Sep 10, 2026Updated Sep 11, 2026

Describe the bug

The W&B-owned Fabric WandbLogger supports save_dir=None, including using its dir alias, but annotates save_dir as _PATH without None. Lightning's _PATH resolves to str | pathlib.Path.

This is an explicit supported constructor branch: logger.py declares _PATH, then handles save_dir is None and the dir alias. The public save_dir and log_dir properties already permit an unset directory.

Minimal reproduction

python
from wandb.integration.lightning.fabric import WandbLogger

logger = WandbLogger(save_dir=None)
print(logger.save_dir, logger.log_dir)  # None None

logger = WandbLogger(save_dir=None, dir="/tmp/fabric-example")
print(logger.save_dir, logger.log_dir)  # /tmp/fabric-example /tmp/fabric-example

Both constructors succeed on 0.30.0 and main. They stay lazy: no wandb.init, login, Run, or service starts. The default constructor's directory remains ".".

Mypy 2.3.1 rejects each save_dir=None call:

Argument "save_dir" to "WandbLogger" has incompatible type "None"; expected "str | Path" [arg-type]

The external alias was verified from the installed Lightning package and its versioned source; it does not include None.

Expected behavior

Have the constructor annotation include its existing supported None input, preserving the current directory/alias behavior.

Environment

  • W&B SDK: 0.30.0; also reproduced on main 8f93d444e29e4d1a50a888899f51051012ee2679
  • Lightning: 2.1.3; Torch: 2.14.0; setuptools: 80.10.2
  • Python: 3.12.12; mypy: 2.3.1
  • OS: macOS 26.1, arm64
  • W&B server: not applicable