Skip to content

Commit e5e5e59

Browse files
Remove hasattr check
1 parent 60ae570 commit e5e5e59

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

pins/drivers.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,10 @@ def load_data(
125125
try:
126126
import rdata
127127

128-
# Can be removed once support for Python 3.8 is dropped.
129-
# The issue is that the last `rdata` available on Python 3.8 was v0.9,
130-
# which doesn'thave the same `rdata.read_rds()` function.
128+
# Equivalent to `rdata.read_rds(f)` but compatible with Python 3.8.
131129
# See https://github.com/rstudio/pins-python/pull/265
132-
if not hasattr(rdata, "read_rds"):
133-
parsed = rdata.parser.parse_file(f)
134-
rdata.conversion.convert(parsed)
135-
136-
return rdata.read_rds(f)
130+
parsed = rdata.parser.parse_file(f)
131+
return rdata.conversion.convert(parsed)
137132
except ModuleNotFoundError:
138133
raise ModuleNotFoundError(
139134
"Install the 'rdata' package to attempt to convert 'rds' files into Python objects."

0 commit comments

Comments
 (0)