nteract/papermill

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

Open

#396 建立於 2019年7月5日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)Python (402 fork)batch import
enhancementhelp wantedidea

倉庫指標

Star
 (5,381 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

-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?

貢獻者指南