Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /GRID-INTELLIGENCE_GRID /tests /providers /test_databricks_connection.py
| #!/usr/bin/env python3 | |
| """Test Databricks connection with environment variables.""" | |
| from src.integration.databricks.client import DatabricksClient | |
| def test_connection(): | |
| print("š Testing Databricks SDK client with environment variables...") | |
| try: | |
| client = DatabricksClient() | |
| clusters = client.list_clusters() | |
| print(f"ā Connection successful! Found {len(clusters)} clusters") | |
| # Show cluster details | |
| for cluster in clusters[:3]: # Show first 3 | |
| cluster_name = cluster.get("cluster_name", "Unknown") | |
| state = cluster.get("state", "Unknown") | |
| print(f" - {cluster_name} ({state})") | |
| return True | |
| except Exception as e: | |
| print(f"ā Connection failed: {e}") | |
| print("\nš” To fix this:") | |
| print("1. Set DATABRICKS_HOST environment variable") | |
| print("2. Set DATABRICKS_TOKEN environment variable") | |
| print("3. Optional: Set DATABRICKS_HTTP_PATH for SQL connector") | |
| return False | |
| if __name__ == "__main__": | |
| test_connection() | |
Xet Storage Details
- Size:
- 1.07 kB
- Xet hash:
- 9a483511ea3a6e5a0af7952dfff90bb4bc9a9d95bd4608a0804f2ddf00ac9ce4
Ā·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.