Skip to content

Commit

Permalink
Revert python library install behavior if index_url not specified (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-db authored Oct 3, 2023
2 parents 3c07387 + a524285 commit e6be1d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
### Fixes

- Optimize now runs after creating / updating liquid clustering tables ([463](https://github.com/databricks/dbt-databricks/pull/463))
- fix Pylance import errors ([471](https://github.com/databricks/dbt-databricks/pull/471))
- Fixing an issue where the new python library install from index behavior breaks users who were already customizing their installs ([472](https://github.com/databricks/dbt-databricks/pull/472))

### Under the Hood

- fix Pylance import errors (thanks @dataders) ([471](https://github.com/databricks/dbt-databricks/pull/471))

## dbt-databricks 1.6.5 (September 26, 2023)

Expand Down
7 changes: 5 additions & 2 deletions dbt/adapters/databricks/python_submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,17 @@ def _submit_job(self, path: str, cluster_spec: dict) -> str:
packages = self.parsed_model["config"].get("packages", [])

# custom index URL or default
index_url = self.parsed_model["config"].get("index_url", "https://pypi.org/simple")
index_url = self.parsed_model["config"].get("index_url", None)

# additional format of packages
additional_libs = self.parsed_model["config"].get("additional_libs", [])
libraries = []

for package in packages:
libraries.append({"pypi": {"package": package, "repo": index_url}})
if index_url:
libraries.append({"pypi": {"package": package, "repo": index_url}})
else:
libraries.append({"pypi": {"package": package}})

for lib in additional_libs:
libraries.append(lib)
Expand Down

0 comments on commit e6be1d3

Please sign in to comment.