nteract/papermill

use `ast.literal_eval()` for `-p` params

Open

#396 opened on Jul 5, 2019

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Python (402 forks)batch import
enhancementhelp wantedidea

Repository metrics

Stars
 (5,381 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

-p seems to imply literal evaluation rather than raw string (-r), thus it should use ast.literal_eval()

Example

papermill ... -p a 1 -r b 2 -p c '[1, 2]'

Current behaviour

# Parameters
a = 1
c = "[1, 2]"
b = "2"

Desired output

# Parameters
a = 1
b = "2"
c = [1, 2]

Any reason why this should not be the case?

Contributor guide