Skip to content

DB connect - Oauth authentication Python SDK - Error #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vladomanlug opened this issue Jun 15, 2023 · 0 comments · May be fixed by #180
Open

DB connect - Oauth authentication Python SDK - Error #174

vladomanlug opened this issue Jun 15, 2023 · 0 comments · May be fixed by #180

Comments

@vladomanlug
Copy link

from databricks.connect import DatabricksSession as SparkSession
from databricks.sdk.core import Config

c = Config(host="https://e2-dogfood.staging.cloud.databricks.com/", cluster_id="0602-101933-eu24cp11")
spark = SparkSession.builder.sdkConfig(c).getOrCreate()
print(spark.range(100).collect())


MissingSectionHeaderError Traceback (most recent call last)
Cell In[3], line 4
1 from databricks.connect import DatabricksSession as SparkSession
2 from databricks.sdk.core import Config
----> 4 c = Config(host="https://e2-dogfood.staging.cloud.databricks.com/", cluster_id="0602-101933-eu24cp11")
5 spark = SparkSession.builder.sdkConfig(c).getOrCreate()
6 print(spark.range(100).collect())

File ~/Documents/Coding/spark_connect_tests/20230615_DBConnect_Test_Oauth/venv_dbconnect_13_1/lib/python3.10/site-packages/databricks/sdk/core.py:493, in Config.init(self, credentials_provider, product, product_version, **kwargs)
491 self._set_inner_config(kwargs)
492 self._load_from_env()
--> 493 self._known_file_config_loader()
494 self._fix_host_if_needed()
495 self._validate()

File ~/Documents/Coding/spark_connect_tests/20230615_DBConnect_Test_Oauth/venv_dbconnect_13_1/lib/python3.10/site-packages/databricks/sdk/core.py:732, in Config._known_file_config_loader(self)
730 return
731 ini_file = configparser.ConfigParser()
--> 732 ini_file.read(config_path)
733 profile = self.profile
734 has_explicit_profile = self.profile is not None

File ~/miniconda3/lib/python3.10/configparser.py:698, in RawConfigParser.read(self, filenames, encoding)
696 try:
697 with open(filename, encoding=encoding) as fp:
--> 698 self._read(fp, filename)
699 except OSError:
700 continue

File ~/miniconda3/lib/python3.10/configparser.py:1086, in RawConfigParser._read(self, fp, fpname)
1084 # no section header in the file?
1085 elif cursect is None:
-> 1086 raise MissingSectionHeaderError(fpname, lineno, line)
1087 # an option line?
1088 else:
1089 mo = self._optcre.match(value)

MissingSectionHeaderError: File contains no section headers.
file: PosixPath('/Users/vladislav.manticlugo/.databrickscfg'), line: 1
'host = https://e2-dogfood.staging.cloud.databricks.com\n'

nfx added a commit that referenced this issue Jun 15, 2023
@nfx nfx linked a pull request Jun 15, 2023 that will close this issue
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 a pull request may close this issue.

1 participant