<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Execute databricks notebook form a python source code. in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/execute-databricks-notebook-form-a-python-source-code/m-p/50751#M28884</link>
    <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;The error you are encountering indicates that there is an issue with establishing a connection to the Databricks host specified in your code. Specifically, the error message "getaddrinfo failed" suggests that the hostname or IP address you provided for the Databricks host cannot be resolved.&lt;/P&gt;&lt;P&gt;Here are a few things you can check and address:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Host Name&lt;/STRONG&gt;: Ensure that you have provided the correct Databricks host name in the DatabricksAPI initialization. It should be in the format https://&amp;lt;your-databricks-instance&amp;gt;.cloud.databricks.com. Make sure there are no typos or mistakes in the host name.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Network Connectivity&lt;/STRONG&gt;: Ensure that your Python environment can access the Databricks host. Check if your system can reach the Databricks host over the network. You can test this by opening a web browser and trying to access the Databricks host's URL.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Firewalls and Network Restrictions&lt;/STRONG&gt;: If you are running the code on a corporate network or behind a firewall, there may be network restrictions that prevent your Python environment from connecting to external hosts. Check if any firewall or proxy settings are blocking the connection.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Proxy Settings&lt;/STRONG&gt;: If your network requires a proxy to access external resources, make sure your Python environment is configured with the correct proxy settings. You can configure proxy settings in Python using the HTTP_PROXY and HTTPS_PROXY environment variables.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Token&lt;/STRONG&gt;: Ensure that you have provided a valid Databricks access token. If the token is incorrect or expired, it can also lead to connection issues.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Databricks Instance Status&lt;/STRONG&gt;: Verify that your Databricks instance is up and running without any issues. Sometimes, temporary outages or maintenance can affect the availability of Databricks services.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;API Version&lt;/STRONG&gt;: Make sure you are using a compatible version of the databricks_api library with your Databricks instance. Check for library updates if necessary.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;By addressing these points, you should be able to resolve the issue and successfully establish a connection to your Databricks host from your Python code.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;Source: &lt;A href="https://chatgptdetector.co/" target="_self"&gt;Chat GPT Detector&lt;/A&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 09 Nov 2023 19:54:28 GMT</pubDate>
    <dc:creator>sewl</dc:creator>
    <dc:date>2023-11-09T19:54:28Z</dc:date>
    <item>
      <title>Execute databricks notebook form a python source code.</title>
      <link>https://community.databricks.com/t5/data-engineering/execute-databricks-notebook-form-a-python-source-code/m-p/4178#M976</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I 'm trying to execute databricks notebook form a python source code but getting error.&lt;/P&gt;&lt;P&gt;source code below&lt;/P&gt;&lt;P&gt;------------------&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;from databricks_api import DatabricksAPI
&amp;nbsp;
# Create a Databricks API client
api = DatabricksAPI(host='databrick_host', token='access token')
&amp;nbsp;
# Define the notebook path
notebook_path = '/Users/xyz@abc.com/data_restoration'
print("A")
&amp;nbsp;
# Create a new run
run = api.jobs.run_now(notebook_path)
print("B)")
&amp;nbsp;
# Wait for the run to complete
run.wait_for_completion()
&amp;nbsp;
# Get the run output
output = api.jobs.get_run_output(run.run_id)
&amp;nbsp;
# Print the output 
for entry in output:
       print(entry['data'])&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output&lt;/P&gt;&lt;P&gt;------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;A
&amp;nbsp;
Traceback (most recent call last):
&amp;nbsp;
 File "C:\Users\sshiv\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 174, in _new_conn
&amp;nbsp;
  conn = connection.create_connection(
&amp;nbsp;
 File "C:\Users\sshiv\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\connection.py", line 72, in create_connection
&amp;nbsp;
  for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
&amp;nbsp;
 File "C:\Users\sshiv\AppData\Local\Programs\Python\Python39\lib\socket.py", line 954, in getaddrinfo
&amp;nbsp;
  for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
&amp;nbsp;
socket.gaierror: [Errno 11001] getaddrinfo failed
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
During handling of the above exception, another exception occurred:
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
Traceback (most recent call last):
&amp;nbsp;
 File "C:\Users\sshiv\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen
&amp;nbsp;
  httplib_response = self._make_request(
&amp;nbsp;
 File "C:\Users\sshiv\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request
&amp;nbsp;
  self._validate_conn(conn)
&amp;nbsp;
 File "C:\Users\sshiv\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 1042, in _validate_conn
&amp;nbsp;
  conn.connect()
&amp;nbsp;
 File "C:\Users\sshiv\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 363, in connect
&amp;nbsp;
  self.sock = conn = self._new_conn()
&amp;nbsp;
 File "C:\Users\sshiv\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 186, in _new_conn
&amp;nbsp;
  raise NewConnectionError(
&amp;nbsp;
urllib3.exceptions.NewConnectionError: &amp;lt;urllib3.connection.HTTPSConnection object at 0x000001F2B2A244C0&amp;gt;: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
Process finished with exit code 1
&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 03:57:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/execute-databricks-notebook-form-a-python-source-code/m-p/4178#M976</guid>
      <dc:creator>shiv4050</dc:creator>
      <dc:date>2023-05-19T03:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Execute databricks notebook form a python source code.</title>
      <link>https://community.databricks.com/t5/data-engineering/execute-databricks-notebook-form-a-python-source-code/m-p/4179#M977</link>
      <description>&lt;P&gt;is your databricks workspace available to your python env? (read: firewall, vNet etc)&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 10:10:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/execute-databricks-notebook-form-a-python-source-code/m-p/4179#M977</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2023-05-25T10:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Execute databricks notebook form a python source code.</title>
      <link>https://community.databricks.com/t5/data-engineering/execute-databricks-notebook-form-a-python-source-code/m-p/4180#M978</link>
      <description>&lt;P&gt;This issue is usually caused by an incorrect hostname or issues with network connectivity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To resolve this issue, please follow these steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Double-check your Databricks host URL. Make sure it is spelled correctly and follows the proper format, such as `https://&amp;lt;region&amp;gt;.azuredatabricks.net`. Replace `&amp;lt;region&amp;gt;` with your Databricks workspace region&lt;A href="https://nogpt.net/" alt="https://nogpt.net/" target="_blank"&gt;.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Verify that you have a stable internet connection and that there are no firewalls or proxies blocking your access to the Databricks host URL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Ensure that your access token is valid and has the necessary permissions to execute the notebook.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 12:50:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/execute-databricks-notebook-form-a-python-source-code/m-p/4180#M978</guid>
      <dc:creator>johnwood</dc:creator>
      <dc:date>2023-05-31T12:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Execute databricks notebook form a python source code.</title>
      <link>https://community.databricks.com/t5/data-engineering/execute-databricks-notebook-form-a-python-source-code/m-p/4181#M979</link>
      <description>&lt;P&gt;I found this youtube video beneficial for setting up my environment with VScode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://youtu.be/n-Wy_VDiOGs" alt="https://youtu.be/n-Wy_VDiOGs" target="_blank"&gt;VS Code Extension with Databricks - 03.13.2023&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 17:45:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/execute-databricks-notebook-form-a-python-source-code/m-p/4181#M979</guid>
      <dc:creator>StephanieAlba</dc:creator>
      <dc:date>2023-05-31T17:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Execute databricks notebook form a python source code.</title>
      <link>https://community.databricks.com/t5/data-engineering/execute-databricks-notebook-form-a-python-source-code/m-p/50751#M28884</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;The error you are encountering indicates that there is an issue with establishing a connection to the Databricks host specified in your code. Specifically, the error message "getaddrinfo failed" suggests that the hostname or IP address you provided for the Databricks host cannot be resolved.&lt;/P&gt;&lt;P&gt;Here are a few things you can check and address:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Host Name&lt;/STRONG&gt;: Ensure that you have provided the correct Databricks host name in the DatabricksAPI initialization. It should be in the format https://&amp;lt;your-databricks-instance&amp;gt;.cloud.databricks.com. Make sure there are no typos or mistakes in the host name.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Network Connectivity&lt;/STRONG&gt;: Ensure that your Python environment can access the Databricks host. Check if your system can reach the Databricks host over the network. You can test this by opening a web browser and trying to access the Databricks host's URL.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Firewalls and Network Restrictions&lt;/STRONG&gt;: If you are running the code on a corporate network or behind a firewall, there may be network restrictions that prevent your Python environment from connecting to external hosts. Check if any firewall or proxy settings are blocking the connection.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Proxy Settings&lt;/STRONG&gt;: If your network requires a proxy to access external resources, make sure your Python environment is configured with the correct proxy settings. You can configure proxy settings in Python using the HTTP_PROXY and HTTPS_PROXY environment variables.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Token&lt;/STRONG&gt;: Ensure that you have provided a valid Databricks access token. If the token is incorrect or expired, it can also lead to connection issues.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Databricks Instance Status&lt;/STRONG&gt;: Verify that your Databricks instance is up and running without any issues. Sometimes, temporary outages or maintenance can affect the availability of Databricks services.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;API Version&lt;/STRONG&gt;: Make sure you are using a compatible version of the databricks_api library with your Databricks instance. Check for library updates if necessary.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;By addressing these points, you should be able to resolve the issue and successfully establish a connection to your Databricks host from your Python code.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;Source: &lt;A href="https://chatgptdetector.co/" target="_self"&gt;Chat GPT Detector&lt;/A&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Nov 2023 19:54:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/execute-databricks-notebook-form-a-python-source-code/m-p/50751#M28884</guid>
      <dc:creator>sewl</dc:creator>
      <dc:date>2023-11-09T19:54:28Z</dc:date>
    </item>
  </channel>
</rss>

