SSL Certificate Error Issue before and after Python 3.11.13 with Databricks Instance

Đang mở
#585 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
database, security

Hướng nghiên cứu

Bắt đầu với thiết lập pyproject.toml và entry point main.py được cung cấp, sau đó chạy lệnh uv trong một môi trường Databricks yêu cầu chứng chỉ SSL trên các phiên bản Python được liệt kê. Sử dụng results.log và SSLVerificationError được báo cáo để so sánh hành vi; hoàn tất khi truy vấn mẫu trả về số lượng hàng của bảng trên các phiên bản bị ảnh hưởng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Overview

When I try to use different versions of python to connect to a databricks environment, I get an SSL certificate issue. It appears to be resolved in 3.11.13 but is broken in versions below (e.g. 3.11.11) and above (3.12, 3.13). Please note that you will need to test with an environment that require an ssl certificate.

Recreation Steps

  1. Setup environment as below
  2. Run script
uv run main.py --python 3.11.11

Expected - The script will output a row count for the specific table
Actual - An SSLVerificationError will happen

Hardware Info

  • macOS - 15.5
  • chip - Apple M4 Pro

Affected Python Version

  • 3.11.11, <3.11.13
  • > 3.11.13

Setup

setup uv project
uv init dbks_testing --python
sample uv project template
[project]
name = "dbks-testing"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
    "databricks-sqlalchemy>=2.0.6",
]
script to verify issue

you will need to change the table variable to a valid table for your schema

def main():

    access_token = os.getenv("DATABRICKS_TOKEN")
    server_hostname = os.getenv("DATABRICKS_SERVER_HOSTNAME")
    http_path = os.getenv("DATABRICKS_HTTP_PATH")
    catalog = os.getenv("DATABRICKS_CATALOG")
    schema = os.getenv("DATABRICKS_SCHEMA")

    engine = create_engine(
        url=f"databricks://token:{access_token}@{server_hostname}?" +
            f"http_path={http_path}&catalog={catalog}&schema={schema}"
    )

    session = Session(engine)

    account = Table(table, MetaData(schema=schema), autoload_with=engine)

    print(f"Table count for {account.name} is {session.query(account).count()}")


if __name__ == "__main__":

    # add logging
    logging.getLogger("databricks.sql").setLevel(logging.DEBUG)
    logging.basicConfig(filename="results.log",
                        level=logging.DEBUG,
                        format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")

    # set variables need for main
    table = "account"

    main()
Run command in project
uv run main.py --python 3.11.11
Ngôn ngữ chính
Python
Star
233
Fork
152
Merge trung bình
21 giờ 5 phút
Pull request đã merge (30 ngày)
10

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của databricks/databricks-sql-python

Tất cả issue của databricks/databricks-sql-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.