Skip to content

Commit 37e6051

Browse files
committed
import with try/except
1 parent b3e431c commit 37e6051

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyspark_huggingface/compat/datasource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import pyspark
44

55

6-
if int(pyspark.__version__.split(".")[0]) >= 4 and pyspark.__version__ not in ("4.0.0.dev0", "4.0.0.dev1"):
6+
try:
77
from pyspark.sql.datasource import DataSource, DataSourceArrowWriter, DataSourceReader, DataSourceWriter, InputPartition, WriterCommitMessage
8-
else:
8+
except ImportError:
99
class DataSource:
1010
def __init__(self, options):
1111
self.options = options

0 commit comments

Comments
 (0)