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

[1.0] Block taking jinja2.runtime.Undefined into DatabricksAdapter. #99

Merged
merged 5 commits into from
May 25, 2022

Conversation

ueshin
Copy link
Collaborator

@ueshin ueshin commented May 23, 2022

Description

Backport of #98

Blocks taking jinja2.runtime.Undefined into DatabricksAdapter.

When calling the adapter method from macros, jinja2.runtime.Undefined can be passed to DatabricksAdapter that could cause unexpected behavior.

For example,

{% if not adapter.check_schema_exists(model.database, model.schema) %}

The model.database is not defined and jinja2.runtime.Undefined will be used to call adapter.check_schema_exists and Cursor.schema() will fail:

[debug] [Thread-13 ]: Databricks adapter: Error while running:
GetSchemas(database=, schema=test16533281379208408401_test_basic)
[debug] [Thread-13 ]: Databricks adapter: <class 'databricks.sql.exc.RequestError'>: Error during request to server
[debug] [Thread-13 ]: finished collecting timing info
[debug] [Thread-13 ]: On snapshot.snapshot_strategy_timestamp.ts_snapshot: Close
[error] [Thread-13 ]: Unhandled error while executing snapshot.snapshot_strategy_timestamp.ts_snapshot
Error during request to server
  Unhandled error while executing snapshot.snapshot_strategy_timestamp.ts_snapshot
Error during request to server

@ueshin ueshin requested a review from allisonwang-db May 23, 2022 18:53
@ueshin
Copy link
Collaborator Author

ueshin commented May 25, 2022

Thanks! merging.

@ueshin ueshin merged commit f01086c into databricks:1.0.latest May 25, 2022
@ueshin ueshin deleted the undefined_proof_1.0 branch May 25, 2022 23:51
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

Successfully merging this pull request may close these issues.

1 participant