Skip to content

Commit 65d7626

Browse files
authored
Make the test-connection log uploader public for reuse (#2749)
Rename _build_log_uploader to build_test_connection_log_uploader so connection-test commands outside soda-core (the soda-extensions diagnostics-warehouse test command) can stream their logs to the same scan-id-keyed Soda Cloud endpoint.
1 parent 7abfb7d commit 65d7626

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

soda-core/src/soda_core/cli/handlers/data_source.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def handle_test_data_source(
5757
# Build the upload Logs before parsing so logs emitted while loading/validating the
5858
# data source YAML — often the most relevant when a connection test fails early — are
5959
# captured and streamed to Soda Cloud.
60-
upload_logs: Optional[Logs] = _build_log_uploader(
60+
upload_logs: Optional[Logs] = build_test_connection_log_uploader(
6161
soda_cloud_file_path=soda_cloud_file_path,
6262
)
6363

@@ -86,12 +86,16 @@ def handle_test_data_source(
8686
upload_logs.close()
8787

8888

89-
def _build_log_uploader(
89+
def build_test_connection_log_uploader(
9090
soda_cloud_file_path: Optional[str],
9191
) -> Optional[Logs]:
9292
"""Returns a ``Logs`` backed by a ``LogsQueue`` bound to the scan id, so
9393
root-logger records during the test stream to Soda Cloud — or None when
9494
there is no scan id / cloud config. Must be closed to flush the final batch.
95+
96+
Public because connection-test commands outside soda-core (e.g. the
97+
soda-extensions ``diagnostics-warehouse test`` command) reuse it to stream
98+
their logs to the same scan-id-keyed endpoint.
9599
"""
96100
# The scan id is a Cloud-only concept set by the Runner/launcher as SODA_SCAN_ID; it is
97101
# read from the env helper rather than a CLI argument so the generic CLI stays Cloud-agnostic.

0 commit comments

Comments
 (0)