Skip to content

Conversation

@saishreeeee
Copy link
Contributor

@saishreeeee saishreeeee commented Jun 10, 2025

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • Other

Description

Added error logging to the init function of Error class
Added export_failure_log to TelemetryClient

How is this tested?

  • Unit tests

  • E2E Tests

  • Manually
    Queried from a non-existent table
    Request Body Summary:
    uploadTime: 1749620674701
    items: 0 items
    protoLogs: 2 logs

        Proto Log #1: Initial connection log
        Proto Log #2: Error log
        {
          "frontend_log_event_id": "b251bea7-c9a8-42e4-b00c-5ea4011d7d17",
          "context": {
            "client_context": {
              "timestamp_millis": 1749716213881,
              "user_agent": "PyDatabricksSqlConnector/4.0.3"
            }
          },
          "entry": {
            "sql_driver_log": {
              "session_id": "<REDACTED>",
              "system_configuration": {
                "driver_version": "4.0.3",
                "os_name": "Darwin",
                "os_version": "24.5.0",
                "os_arch": "arm64",
                "runtime_name": "Python 3.13.3",
                "runtime_version": "3.13.3",
                "runtime_vendor": "CPython",
                "driver_name": "Databricks SQL Python Connector",
                "char_set_encoding": "utf-8",
                "locale_name": "en_US"
              },
              "driver_connection_params": {
                "http_path": "<REDACTED>",
                "mode": "THRIFT",
                "host_info": {
                  "host_url": "<REDACTED>",
                  "port": 443
                },
                "auth_mech": "PAT"
              },
              "error_info": {
                "error_name": "ServerOperationError",
                "stack_trace": "[TABLE_OR_VIEW_NOT_FOUND] The table or view `non_existent_table` cannot be found. Verify the spelling and correctness of the schema and catalog.\nIf you did not qualify the name with a schema, verify the current_schema() output, or qualify the name with the correct schema and catalog.\nTo tolerate the error on drop use DROP VIEW IF EXISTS or DROP TABLE IF EXISTS. SQLSTATE: 42P01; line 2 pos 33"
              }
            }
          }
        }          
        === Response Details ===
        Status Code: 200
        Response Body:
        {
          "errors": [],
          "numSuccess": 0,
          "numProtoSuccess": 2,
          "numRealtimeSuccess": 0
        }
    
  • N/A

The coverage of telemetry_client.py by test_telemetry.py's unit tests are as below.

Module Statements Miss Cover Missing
telemetry_client.py 186 15 92% 107, 111, 115, 331-339, 364-367, 380-382

Related Tickets & Documents

PECOBLR-524

@samikshya-db
Copy link
Contributor

Let's elaborate on testing details, maybe include a redacted log JSON ?

@samikshya-db
Copy link
Contributor

From your JSON, can we skip null fields while building the telemetry request?

This comment was marked as outdated.

@github-actions
Copy link

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
@github-actions
Copy link

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
@github-actions
Copy link

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
@github-actions
Copy link

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
@github-actions
Copy link

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
@github-actions
Copy link

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

Copy link
Contributor

@samikshya-db samikshya-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. thanks for getting this through 🎉

@saishreeeee saishreeeee merged commit cf89ce3 into telemetry Jun 19, 2025
23 of 26 checks passed
@saishreeeee saishreeeee deleted the PECOBLR-524 branch August 1, 2025 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants