<?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: Is it possible to make use of pygit2 or GitPython packages to reference git repositories from within databricks? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21332#M14532</link>
    <description>&lt;P&gt;I'm having the same issue. I couldn't see anything in the documentation that @Kaniz Fatma​&amp;nbsp;posted which answers this question either. &lt;/P&gt;&lt;P&gt;It looks like the `.git/` subdirectory isn't actually present at the top level of the repo in databricks, which seems strange. I don't really understand why that would be and how git works in databricks without the `.git/` subdir ...&lt;/P&gt;</description>
    <pubDate>Tue, 24 May 2022 16:46:04 GMT</pubDate>
    <dc:creator>ben_406796</dc:creator>
    <dc:date>2022-05-24T16:46:04Z</dc:date>
    <item>
      <title>Is it possible to make use of pygit2 or GitPython packages to reference git repositories from within databricks?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21330#M14530</link>
      <description>&lt;P&gt;I am making use of repos in databricks and am trying to reference the current git branch from within the notebook session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from pygit2 import Repository&lt;/P&gt;&lt;P&gt;repo = Repository('/Workspace/Repos/user@domain/repository')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code above throws an error stating that the repository cannot be found. Similar errors are thrown with GitPython as well. It seems to me that DataBricks Repos are configured in a way that means these packages cannot recognise them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any experience of this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 16:37:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21330#M14530</guid>
      <dc:creator>tompile</dc:creator>
      <dc:date>2022-05-06T16:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to make use of pygit2 or GitPython packages to reference git repositories from within databricks?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21332#M14532</link>
      <description>&lt;P&gt;I'm having the same issue. I couldn't see anything in the documentation that @Kaniz Fatma​&amp;nbsp;posted which answers this question either. &lt;/P&gt;&lt;P&gt;It looks like the `.git/` subdirectory isn't actually present at the top level of the repo in databricks, which seems strange. I don't really understand why that would be and how git works in databricks without the `.git/` subdir ...&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 16:46:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21332#M14532</guid>
      <dc:creator>ben_406796</dc:creator>
      <dc:date>2022-05-24T16:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to make use of pygit2 or GitPython packages to reference git repositories from within databricks?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21333#M14533</link>
      <description>&lt;P&gt;Agreed, it seems very odd. @Kaniz Fatma​, are you able to assist any further on this? Is there somewhere in the linked documentation in particular that you believe would be helpful?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 09:03:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21333#M14533</guid>
      <dc:creator>tompile</dc:creator>
      <dc:date>2022-06-06T09:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to make use of pygit2 or GitPython packages to reference git repositories from within databricks?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21334#M14534</link>
      <description>&lt;P&gt;Hi @Thomas Pile​,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a friendly follow-up. Did you were able to find a solution or you still need help? please let us know. &lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 00:25:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21334#M14534</guid>
      <dc:creator>jose_gonzalez</dc:creator>
      <dc:date>2022-07-29T00:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to make use of pygit2 or GitPython packages to reference git repositories from within databricks?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21335#M14535</link>
      <description>&lt;P&gt;@Jose Gonzalez​&amp;nbsp;I cannot speak for @Thomas Pile​&amp;nbsp;but I am also struggling with this issue and have been unable to find a solution&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 13:15:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21335#M14535</guid>
      <dc:creator>ben_406796</dc:creator>
      <dc:date>2022-07-29T13:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to make use of pygit2 or GitPython packages to reference git repositories from within databricks?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21336#M14536</link>
      <description>&lt;P&gt;Hi @Jose Gonzalez​. I haven't been able to find a solution yet either. Are you able to help?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 13:30:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21336#M14536</guid>
      <dc:creator>tompile</dc:creator>
      <dc:date>2022-07-29T13:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to make use of pygit2 or GitPython packages to reference git repositories from within databricks?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21337#M14537</link>
      <description>&lt;P&gt;You cannot use this as far as i know, but you can put a workaround in a notebook if you are calling code from your repo via a notebook:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;repo_path = "/Repos/xyz_repo_path/xyz_repo_name"&lt;/P&gt;&lt;P&gt;repo_path_fs = "/Workspace" + repo_path&lt;/P&gt;&lt;P&gt;repo_branch = "main"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def checkRepoInfo():&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;nb_context= json.loads(dbutils.notebook.entry_point.getDbutils().notebook().getContext().toJson())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;api_url = nb_context['extraContext']['api_url']&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;api_token = nb_context['extraContext']['api_token']&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;db_repo_data = requests.get(f"{api_url}/api/2.0/repos",&amp;nbsp;headers = {"Authorization": f"Bearer {api_token}"}).json()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;for db_repo in db_repo_data["repos"]:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;db_repo_id = db_repo["id"]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;db_repo_path = db_repo["path"]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;db_repo_branch = db_repo["branch"]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;db_repo_head_commit = db_repo["head_commit_id"]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if db_repo["path"] == repo_path:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print ("Git commit info: ID: {} | Path: {} | Branch: {} | Commit: {}".format(db_repo_id, db_repo_path, db_repo_branch ,db_repo_head_commit))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;assert db_repo_branch == repo_branch&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;checkRepoInfo()&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 12:55:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-it-possible-to-make-use-of-pygit2-or-gitpython-packages-to/m-p/21337#M14537</guid>
      <dc:creator>niburg123</dc:creator>
      <dc:date>2022-09-15T12:55:06Z</dc:date>
    </item>
  </channel>
</rss>

