Skip to content

Commit d0b9c19

Browse files
Replace logging with print
1 parent fd8e7e7 commit d0b9c19

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pyspark_datasources/jsonplaceholder.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import Dict, Any, List, Iterator
22
import requests
3-
import logging
43
from pyspark.sql.datasource import DataSource, DataSourceReader, InputPartition
54
from pyspark.sql.types import StructType
65
from pyspark.sql import Row
@@ -136,13 +135,13 @@ def read(self, partition: InputPartition) -> Iterator[Row]:
136135
return iter([self._process_item(item) for item in data])
137136

138137
except requests.RequestException as e:
139-
logging.warning(f"Failed to fetch data from {url}: {e}")
138+
print(f"Failed to fetch data from {url}: {e}")
140139
return iter([])
141140
except ValueError as e:
142-
logging.warning(f"Failed to parse JSON from {url}: {e}")
141+
print(f"Failed to parse JSON from {url}: {e}")
143142
return iter([])
144143
except Exception as e:
145-
logging.error(f"Unexpected error while reading data: {e}")
144+
print(f"Unexpected error while reading data: {e}")
146145
return iter([])
147146

148147
def _process_item(self, item: Dict[str, Any]) -> Row:

0 commit comments

Comments
 (0)