cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Databricks Connect V2 - OPENSSL_internal: CERTIFICATE_VERIFY_FAILED

TCorr15
New Contributor

I am getting an error when using Databricks V2 in when running anything relating to databricks-sql-connector/databricks.sql.connect(). Would anyone know how to resolve this issue?

Sample Error Message

TCorr15_0-1706177740099.png

 

Additional Details

Python Version 3.11.4

Sample Code

from databricks.connect import DatabricksSession
from pyspark.sql.types import *
from datetime import date
import ssl

try:
    _create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
    pass
else:
    ssl._create_default_https_context = _create_unverified_https_context

spark = DatabricksSession.builder.getOrCreate()
 
schema = StructType([
  StructField('AirportCode', StringType(), False),
  StructField('Date', DateType(), False),
  StructField('TempHighF', IntegerType(), False),
  StructField('TempLowF', IntegerType(), False)
])

data = [
  [ 'BLI', date(2021, 4, 3), 52, 43],
  [ 'BLI', date(2021, 4, 2), 50, 38],
  [ 'BLI', date(2021, 4, 1), 52, 41],
  [ 'PDX', date(2021, 4, 3), 64, 45],
  [ 'PDX', date(2021, 4, 2), 61, 41],
  [ 'PDX', date(2021, 4, 1), 66, 39],
  [ 'SEA', date(2021, 4, 3), 57, 43],
  [ 'SEA', date(2021, 4, 2), 54, 39],
  [ 'SEA', date(2021, 4, 1), 56, 41]
]
 
spark.sql('USE default')   # FAIL HERE
spark.sql('DROP TABLE IF EXISTS zzz_demo_temps_table')
temps.write.saveAsTable('zzz_demo_temps_table')
1 REPLY 1

arpit
Contributor III
Contributor III

Can you directly use Databricks connect and validate if it works from CLI?
Also, confirm the databrics-connect version please 

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.