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

[FEATURE] Introduce escape_sql_identifier to safely escape SQL identifiers like table, view and column names #280

Open
JCZuurmond opened this issue Sep 13, 2024 · 0 comments

Comments

@JCZuurmond
Copy link
Contributor

JCZuurmond commented Sep 13, 2024

See the code in ucx: https://github.com/databrickslabs/ucx/blob/125ccfa19b3f3bb3569e576b2f38ed4d62d13330/src/databricks/labs/ucx/framework/utils.py#L7.

Also use it in lsql where appropriate

Add it to backends or utils. Decide on what makes sense most

nfx pushed a commit that referenced this issue Sep 26, 2024
…ore` (#296)

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
nfx added a commit that referenced this issue 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 issue Sep 26, 2024
nfx added a commit that referenced this issue 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
None yet
Projects
None yet
Development

No branches or pull requests

1 participant