Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion papermill/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def print_papermill_version(ctx, param, value):
)
@click.option('--parameters', '-p', nargs=2, multiple=True, help='Parameters to pass to the parameters cell.')
@click.option('--parameters_raw', '-r', nargs=2, multiple=True, help='Parameters to be read as raw string.')
@click.option('--parameters_file', '-f', multiple=True, help='Path to YAML file containing parameters.')
@click.option('--parameters_file', '-f', multiple=True, help='Path to YAML or TOML file containing parameters.')
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This help text now claims --parameters_file accepts TOML, but the implementation still routes to read_yaml_file(...), which only loads YAML/JSON and enforces extensions ['.json', '.yaml', '.yml']. Either implement TOML support end-to-end (loader + CLI wiring) or keep the help text YAML-only to avoid misleading users.

Suggested change
@click.option('--parameters_file', '-f', multiple=True, help='Path to YAML or TOML file containing parameters.')
@click.option('--parameters_file', '-f', multiple=True, help='Path to YAML file containing parameters.')

Copilot uses AI. Check for mistakes.
@click.option('--parameters_yaml', '-y', multiple=True, help='YAML string to be used as parameters.')
@click.option('--parameters_base64', '-b', multiple=True, help='Base64 encoded YAML string as parameters.')
@click.option(
Expand Down
8 changes: 8 additions & 0 deletions papermill/iorw.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
import warnings
from contextlib import contextmanager

try:
import tomllib
except ModuleNotFoundError:
try:
import tomli as tomllib
except ModuleNotFoundError:
tomllib = None

Comment on lines +8 to +15
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly added tomllib/tomli import is currently unused anywhere in this module, which will fail Ruff/Pyflakes (unused import/unused variable). Either wire this into the parameters-file loader (e.g., TOML parsing) or remove the import until it’s used. If TOML support is intended for Python 3.10, also ensure the tomli fallback is an actual dependency (or raise a clear error when tomllib is None).

Suggested change
try:
import tomllib
except ModuleNotFoundError:
try:
import tomli as tomllib
except ModuleNotFoundError:
tomllib = None

Copilot uses AI. Check for mistakes.
import entrypoints
import nbformat
import requests
Expand Down
Loading