Closed jrycw closed 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 86.72%. Comparing base (
016c67f
) to head (8fa2fd4
). Report is 15 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@rich-iannone do you mind taking a look? Especially on double checkingnorm_path
's job there? Seems like a nice addition!
(may be useful for us to leave a note here on what would happen in the gt r package if someone used an http path)
Hello team,
I'd like to format the column by providing an HTTP/HTTPS URL to the
path
parameter inGT.fmt_image()
like so:I was expecting this outcome:
However, I'm encountering a
TypeError: sub() missing 1 required positional argument: 'string'
.It appears that the error originates from this line: https://github.com/posit-dev/great-tables/blob/016c67f7cf75272ac4bff0b678383a8f8993c985/great_tables/_formats.py#L3529
If I understand correctly, this line is intended to do two things: (1) remove trailing spaces, if any, and (2) remove the trailing
/
, if present. To fix this, the line could be updated as follows:This would:
re.sub()
.+
modifier to*
to allow for zero or more spaces.That said, I believe using
self.path.rstrip().removesuffix("/")
as proposed in this PR is more straightforward and easier to understand.