Skip to content

Commit 1a8a772

Browse files
Remove hasattr check
1 parent 1122cdb commit 1a8a772

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
@@ -124,15 +124,10 @@ def load_data(
124124
try:
125125
import rdata
126126

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

0 commit comments

Comments
 (0)