nteract/papermill

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

Aperta

#396 aperta il 5 lug 2019

 (1 commento) (0 reazioni) (0 assegnatari)Python (402 fork)batch import
enhancementhelp wantedidea

Metriche repository

Star
 (5381 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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

Guida contributor