Skip to content

Commit 30392be

Browse files
fix: address PR feedback - add detailed SQLite threading explanation and revert variable name
- Add detailed explanation of SQLite threading compatibility issue in Python 3.12+ - Revert variable name from 'base_exception_trace' to 'exception_trace' - Addresses PR comments from @aaronsteers Co-Authored-By: AJ Steers <[email protected]>
1 parent 858a28d commit 30392be

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

unit_tests/sources/declarative/test_concurrent_declarative_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ def mocked_init(self, is_sequential_state: bool = True):
964964
)
965965
@pytest.mark.skipif(
966966
sys.version_info >= (3, 12),
967-
reason="Concurrent read failure compatibility issue with Python 3.12+",
967+
reason="SQLite threading compatibility issue: Python 3.12+ has stricter thread safety checks that cause 'InterfaceError: bad parameter or other API misuse' when SQLite connections are shared across threads in the concurrent framework",
968968
)
969969
def test_read_with_concurrent_and_synchronous_streams():
970970
"""

unit_tests/test_exception_handler.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,15 @@ def test_uncaught_exception_handler():
4848
cmd = "from airbyte_cdk.logger import init_logger; from airbyte_cdk.exception_handler import init_uncaught_exception_handler; logger = init_logger('airbyte'); init_uncaught_exception_handler(logger); raise 1"
4949
exception_message = "exceptions must derive from BaseException"
5050

51-
base_exception_trace = (
51+
exception_trace = (
5252
"Traceback (most recent call last):\n"
5353
' File "<string>", line 1, in <module>\n'
5454
"TypeError: exceptions must derive from BaseException"
5555
)
5656

5757
expected_log_message = AirbyteMessage(
5858
type=MessageType.LOG,
59-
log=AirbyteLogMessage(
60-
level=Level.FATAL, message=f"{exception_message}\n{base_exception_trace}"
61-
),
59+
log=AirbyteLogMessage(level=Level.FATAL, message=f"{exception_message}\n{exception_trace}"),
6260
)
6361

6462
expected_trace_message = AirbyteMessage(
@@ -70,7 +68,7 @@ def test_uncaught_exception_handler():
7068
failure_type=FailureType.system_error,
7169
message="Something went wrong in the connector. See the logs for more details.",
7270
internal_message=exception_message,
73-
stack_trace=f"{base_exception_trace}\n",
71+
stack_trace=f"{exception_trace}\n",
7472
),
7573
),
7674
)
@@ -86,7 +84,7 @@ def test_uncaught_exception_handler():
8684
log_output, trace_output = stdout_lines
8785

8886
out_log_message = AirbyteMessageSerializer.load(json.loads(log_output))
89-
assert base_exception_trace in out_log_message.log.message, (
87+
assert exception_trace in out_log_message.log.message, (
9088
"Log message should contain expected traceback format"
9189
)
9290
assert exception_message in out_log_message.log.message, (
@@ -95,7 +93,7 @@ def test_uncaught_exception_handler():
9593

9694
out_trace_message = AirbyteMessageSerializer.load(json.loads(trace_output))
9795
assert out_trace_message.trace.emitted_at > 0
98-
assert base_exception_trace in out_trace_message.trace.error.stack_trace, (
96+
assert exception_trace in out_trace_message.trace.error.stack_trace, (
9997
"Trace message should contain expected traceback format"
10098
)
10199
assert out_trace_message.trace.error.internal_message == exception_message, (

0 commit comments

Comments
 (0)