Skip to content

Commit

Permalink
Add exception handler
Browse files Browse the repository at this point in the history
  • Loading branch information
riyaverm-db committed May 29, 2024
1 parent 2a50ba1 commit 08350ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/pyspark/sql/tests/test_python_streaming_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
SimpleDataSourceStreamReader,
WriterCommitMessage,
)
from pyspark.sql.streaming import StreamingQueryException
from pyspark.sql.types import Row
from pyspark.testing.sqlutils import (
have_pyarrow,
Expand Down Expand Up @@ -231,6 +232,8 @@ def test_stream_writer(self):
[Row("failed in batch 1")],
)
q.awaitTermination()
except StreamingQueryException as e:
self.assertIn("invalid value", str(e))
finally:
input_dir.cleanup()
output_dir.cleanup()
Expand Down

0 comments on commit 08350ad

Please sign in to comment.