Skip to content
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

Set catalog on SchemaDeployer to overwrite the default hive_metastore #296

Merged
merged 22 commits into from
Sep 26, 2024

Conversation

JCZuurmond
Copy link
Member

Set catalog on SchemaDeployer to overwrite the default hive_metastore

Linked issues

Resolves #294
Needs #280 (tech debt to tackle later)
Progresses #278
Requires #287 for the CI to pass

@JCZuurmond JCZuurmond added the enhancement New feature or request label Sep 26, 2024
@JCZuurmond JCZuurmond self-assigned this Sep 26, 2024
Copy link

github-actions bot commented Sep 26, 2024

✅ 35/35 passed, 4 skipped, 9m58s total

Running from acceptance #419

Copy link
Member Author

@JCZuurmond JCZuurmond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments

src/databricks/labs/lsql/deployment.py Outdated Show resolved Hide resolved
self,
sql_backend: SqlBackend,
inventory_schema: str,
mod: Any,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I would remove this or make it optional as views are not always required and could be supplied in different ways (like path to SQL file or SQL as text), but also not changing in this PR

src/databricks/labs/lsql/deployment.py Outdated Show resolved Hide resolved
src/databricks/labs/lsql/deployment.py Outdated Show resolved Hide resolved
@@ -140,7 +140,7 @@ class StatementExecutionExt:
megabytes or gigabytes of data serialized in Apache Arrow format, and low result fetching latency, should use
the stateful Databricks SQL Connector for Python."""

def __init__( # pylint: disable=too-many-arguments
def __init__( # pylint: disable=too-many-arguments,too-many-positional-arguments
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No lint CI fails on this line, which was required by the linter

Copy link
Collaborator

@nfx nfx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nfx nfx merged commit 1d50c70 into main Sep 26, 2024
7 of 8 checks passed
@nfx nfx deleted the feat/set-catalog-on-schema-deployer branch September 26, 2024 12:13
nfx added a commit that referenced this pull request Sep 26, 2024
* Bump actions/checkout from 4.1.7 to 4.2.0 ([#295](#295)). In this version 4.2.0 release of the `actions/checkout` library, the team has added `Ref` and `Commit` outputs, which provide the ref and commit that were checked out, respectively. The update also includes dependency updates to `braces`, `minor-npm-dependencies`, `docker/build-push-action`, and `docker/login-action`, all of which were automatically resolved by Dependabot. These updates improve compatibility and stability for users of the library. This release is a result of contributions from new team members @yasonk and @lucacome. Users can find a detailed commit history, pull requests, and release notes in the associated links. The team strongly encourages all users to upgrade to this new version to access the latest features and improvements.
* Set catalog on `SchemaDeployer` to overwrite the default `hive_metastore` ([#296](#296)). In this release, the default catalog for `SchemaDeployer` has been changed from `hive_metastore` to a user-defined catalog, allowing for more flexibility in deploying resources to different catalogs. A new dependency, `databricks-labs-pytester`, has been added with a version constraint of `>=0.2.1`, which may indicate the introduction of new testing functionality. The `SchemaDeployer` class has been updated to accept a `catalog` parameter and the tests for deploying and deleting schemas, tables, and views have been updated to reflect these changes. The `test_deploys_schema`, `test_deploys_dataclass`, and `test_deploys_view` tests have been updated to accept a `inventory_catalog` parameter, and the `caplog` fixture is used to capture log messages and assert that they contain the expected messages. Additionally, a new test function `test_statement_execution_backend_overwrites_table` has been added to the `tests/integration/test_backends.py` file to test the functionality of the `StatementExecutionBackend` class in overwriting a table in the database and retrieving the correct data. Issue [#294](#294) has been resolved, and progress has been made on issue [#278](#278), but issue [#280](#280) has been marked as technical debt and issue [#287](#287) is required for the CI to pass.

Dependency updates:

 * Bump actions/checkout from 4.1.7 to 4.2.0 ([#295](#295)).
@nfx nfx mentioned this pull request Sep 26, 2024
nfx added a commit that referenced this pull request Sep 26, 2024
* Bump actions/checkout from 4.1.7 to 4.2.0
([#295](#295)). In this
version 4.2.0 release of the `actions/checkout` library, the team has
added `Ref` and `Commit` outputs, which provide the ref and commit that
were checked out, respectively. The update also includes dependency
updates to `braces`, `minor-npm-dependencies`,
`docker/build-push-action`, and `docker/login-action`, all of which were
automatically resolved by Dependabot. These updates improve
compatibility and stability for users of the library. This release is a
result of contributions from new team members @yasonk and @lucacome.
Users can find a detailed commit history, pull requests, and release
notes in the associated links. The team strongly encourages all users to
upgrade to this new version to access the latest features and
improvements.
* Set catalog on `SchemaDeployer` to overwrite the default
`hive_metastore`
([#296](#296)). In this
release, the default catalog for `SchemaDeployer` has been changed from
`hive_metastore` to a user-defined catalog, allowing for more
flexibility in deploying resources to different catalogs. A new
dependency, `databricks-labs-pytester`, has been added with a version
constraint of `>=0.2.1`, which may indicate the introduction of new
testing functionality. The `SchemaDeployer` class has been updated to
accept a `catalog` parameter and the tests for deploying and deleting
schemas, tables, and views have been updated to reflect these changes.
The `test_deploys_schema`, `test_deploys_dataclass`, and
`test_deploys_view` tests have been updated to accept a
`inventory_catalog` parameter, and the `caplog` fixture is used to
capture log messages and assert that they contain the expected messages.
Additionally, a new test function
`test_statement_execution_backend_overwrites_table` has been added to
the `tests/integration/test_backends.py` file to test the functionality
of the `StatementExecutionBackend` class in overwriting a table in the
database and retrieving the correct data. Issue
[#294](#294) has been
resolved, and progress has been made on issue
[#278](#278), but issue
[#280](#280) has been
marked as technical debt and issue
[#287](#287) is required
for the CI to pass.

Dependency updates:

* Bump actions/checkout from 4.1.7 to 4.2.0
([#295](#295)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Set catalog on SchemaDeployer
2 participants