pins-r
pins-r copied to clipboard
Ensure R and python pins have compatible api_version behavior
Currently, it seems like R and python pins treat api_version differently:
- R pins:
-
Sometimes sets api_version using
0L
,1L
, but reads it as a numeric (screenshot below) - Has an error message that suggests version might have a format like
x.y.z
in the future
-
Sometimes sets api_version using
- Python pins:
- Sets api_version as an integer (
1
), and has a type hint that suggests it expects an integer - Just reads api_version from the yaml, so fine reading R pins metadata, and having it be a float (e.g.
1.0
)
- Sets api_version as an integer (
Options
It seems like if we want to preserve compatibility with the current R pins, we have two safe options for api_version:
-
one part: It follows the form
0
,1
,2
, etc.. -
two parts: It allows one period, e.g.
1.1
,2.0
And then one crazy option--three parts, allowing the string "x.y.z"
-- since in R:
-
"0" > 1
-> False -
"1" > 1
-> False - But we'd have to be very careful, since
"1.0" > 1
-> True
(Also I can't remember exactly how these comparisons work, so could be missing some bad behavior; but it should be okay as long as "2.0.0" etc > 1
?)