Skip to content

Commit 6302327

Browse files
committed
changed to doc string
Signed-off-by: Sai Shree Pradhan <[email protected]>
1 parent 1c467f3 commit 6302327

8 files changed

+74
-69
lines changed

src/databricks/sql/telemetry/DriverConnectionParameters.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ def to_json(self):
2323
return json.dumps(asdict(self))
2424

2525

26-
# Part of TelemetryEvent
27-
# DriverConnectionParameters connectionParams = new DriverConnectionParameters(
28-
# httpPath = " /sql/1.0/endpoints/1234567890abcdef",
29-
# driverMode = "THRIFT",
30-
# hostDetails = new HostDetails(
31-
# hostUrl = "https://my-workspace.cloud.databricks.com",
32-
# port = 443
33-
# ),
34-
# authMech = "OAUTH",
35-
# authFlow = "AZURE_MANAGED_IDENTITIES",
36-
# authScope = "sql",
37-
# discoveryUrl = "https://example-url",
38-
# allowedVolumeIngestionPaths = "[]",
39-
# azureTenantId = "1234567890abcdef",
40-
# socketTimeout = 10000
41-
# )
26+
""" Part of TelemetryEvent
27+
DriverConnectionParameters connectionParams = new DriverConnectionParameters(
28+
httpPath = " /sql/1.0/endpoints/1234567890abcdef",
29+
driverMode = "THRIFT",
30+
hostDetails = new HostDetails(
31+
hostUrl = "https://my-workspace.cloud.databricks.com",
32+
port = 443
33+
),
34+
authMech = "OAUTH",
35+
authFlow = "AZURE_MANAGED_IDENTITIES",
36+
authScope = "sql",
37+
discoveryUrl = "https://example-url",
38+
allowedVolumeIngestionPaths = "[]",
39+
azureTenantId = "1234567890abcdef",
40+
socketTimeout = 10000
41+
)"""

src/databricks/sql/telemetry/DriverErrorInfo.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ def to_json(self):
1111
return json.dumps(asdict(self))
1212

1313

14-
# Required for ErrorLogs
15-
# DriverErrorInfo errorInfo = new DriverErrorInfo(
16-
# errorName="CONNECTION_ERROR",
17-
# stackTrace="Connection failure while using the Databricks SQL Python connector. Failed to connect to server: https://my-workspace.cloud.databricks.com\n" +
18-
# "databricks.sql.exc.OperationalError: Connection refused: connect\n" +
19-
# "at databricks.sql.thrift_backend.ThriftBackend.make_request(ThriftBackend.py:329)\n" +
20-
# "at databricks.sql.thrift_backend.ThriftBackend.attempt_request(ThriftBackend.py:366)\n" +
21-
# "at databricks.sql.thrift_backend.ThriftBackend.open_session(ThriftBackend.py:575)\n" +
22-
# "at databricks.sql.client.Connection.__init__(client.py:69)\n" +
23-
# "at databricks.sql.client.connect(connection.py:123)")
14+
"""Required for ErrorLogs
15+
DriverErrorInfo errorInfo = new DriverErrorInfo(
16+
errorName="CONNECTION_ERROR",
17+
stackTrace="Connection failure while using the Databricks SQL Python connector. Failed to connect to server: https://my-workspace.cloud.databricks.com\n" +
18+
"databricks.sql.exc.OperationalError: Connection refused: connect\n" +
19+
"at databricks.sql.thrift_backend.ThriftBackend.make_request(ThriftBackend.py:329)\n" +
20+
"at databricks.sql.thrift_backend.ThriftBackend.attempt_request(ThriftBackend.py:366)\n" +
21+
"at databricks.sql.thrift_backend.ThriftBackend.open_session(ThriftBackend.py:575)\n" +
22+
"at databricks.sql.client.Connection.__init__(client.py:69)\n" +
23+
"at databricks.sql.client.connect(connection.py:123)")
24+
"""

src/databricks/sql/telemetry/DriverSystemConfiguration.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@ def to_json(self):
2121
return json.dumps(asdict(self))
2222

2323

24-
# Part of TelemetryEvent
25-
# DriverSystemConfiguration systemConfig = new DriverSystemConfiguration(
26-
# driver_version = "2.9.3",
27-
# os_name = "Darwin",
28-
# os_version = "24.4.0",
29-
# os_arch = "arm64",
30-
# runtime_name = "CPython",
31-
# runtime_version = "3.13.3",
32-
# runtime_vendor = "cpython",
33-
# client_app_name = "databricks-sql-python",
34-
# locale_name = "en_US",
35-
# driver_name = "databricks-sql-python",
36-
# char_set_encoding = "UTF-8"
37-
# )
24+
"""Part of TelemetryEvent
25+
DriverSystemConfiguration systemConfig = new DriverSystemConfiguration(
26+
driver_version = "2.9.3",
27+
os_name = "Darwin",
28+
os_version = "24.4.0",
29+
os_arch = "arm64",
30+
runtime_name = "CPython",
31+
runtime_version = "3.13.3",
32+
runtime_vendor = "cpython",
33+
client_app_name = "databricks-sql-python",
34+
locale_name = "en_US",
35+
driver_name = "databricks-sql-python",
36+
char_set_encoding = "UTF-8"
37+
)
38+
"""

src/databricks/sql/telemetry/DriverVolumeOperation.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ def to_json(self):
1414
return json.dumps(asdict(self))
1515

1616

17-
# Part of TelemetryEvent
18-
# DriverVolumeOperation volumeOperation = new DriverVolumeOperation(
19-
# volumeOperationType = "LIST",
20-
# volumePath = "/path/to/volume"
21-
# )
17+
""" Part of TelemetryEvent
18+
DriverVolumeOperation volumeOperation = new DriverVolumeOperation(
19+
volumeOperationType = "LIST",
20+
volumePath = "/path/to/volume"
21+
)
22+
"""

src/databricks/sql/telemetry/FrontendLogContext.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ def to_json(self):
1111
return json.dumps(asdict(self))
1212

1313

14-
# used in TelemetryFrontendLog
15-
# FrontendLogContext frontendLogContext = new FrontendLogContext(
16-
# clientContext = new TelemetryClientContext(
17-
# timestampMillis = 1716489600000,
18-
# userAgent = "databricks-sql-python-test"
19-
# )
20-
# )
14+
"""used in TelemetryFrontendLog
15+
FrontendLogContext frontendLogContext = new FrontendLogContext(
16+
clientContext = new TelemetryClientContext(
17+
timestampMillis = 1716489600000,
18+
userAgent = "databricks-sql-python-test"
19+
)
20+
)
21+
"""

src/databricks/sql/telemetry/HostDetails.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ def to_json(self):
1111
return json.dumps(asdict(self))
1212

1313

14-
# Part of DriverConnectionParameters
15-
# HostDetails hostDetails = new HostDetails(
16-
# hostUrl = "https://my-workspace.cloud.databricks.com",
17-
# port = 443
18-
# )
14+
""" Part of DriverConnectionParameters
15+
HostDetails hostDetails = new HostDetails(
16+
hostUrl = "https://my-workspace.cloud.databricks.com",
17+
port = 443
18+
)
19+
"""

src/databricks/sql/telemetry/SqlExecutionEvent.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ def to_json(self):
1515
return json.dumps(asdict(self))
1616

1717

18-
# Part of TelemetryEvent
19-
# SqlExecutionEvent sqlExecutionEvent = new SqlExecutionEvent(
20-
# statementType = "QUERY",
21-
# isCompressed = true,
22-
# executionResult = "INLINE_ARROW",
23-
# retryCount = 0
24-
# )
18+
"""Part of TelemetryEvent
19+
SqlExecutionEvent sqlExecutionEvent = new SqlExecutionEvent(
20+
statementType = "QUERY",
21+
isCompressed = true,
22+
executionResult = "INLINE_ARROW",
23+
retryCount = 0
24+
)"""

src/databricks/sql/telemetry/TelemetryClientContext.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def to_json(self):
1111
return json.dumps(asdict(self))
1212

1313

14-
# used in FrontendLogContext
15-
# TelemetryClientContext clientContext = new TelemetryClientContext(
16-
# timestampMillis = 1716489600000,
17-
# userAgent = "databricks-sql-python-test"
18-
# )
14+
"""used in FrontendLogContext
15+
TelemetryClientContext clientContext = new TelemetryClientContext(
16+
timestampMillis = 1716489600000,
17+
userAgent = "databricks-sql-python-test"
18+
)"""

0 commit comments

Comments
 (0)