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

Mismatched Keys: Update read_dlt_delta() with key "source_database" instead of "database" #33

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

rtdtwo
Copy link
Contributor

@rtdtwo rtdtwo commented Jan 19, 2024

Issue:

When the bronze_dataflow_spec dataframe is created in onboard_dataflowspec.py, the database is included with key source_database in the sourceDetails field. However, in pipeline_readers.py > read_dlt_delta(), it is accessed with key database instead.

Fix:

Change the key to source_database in pipeline_readers.py > read_dlt_delta().

onboard_dataflowspec.py sets key "source_database" when creating bronze dataflow spec dataframe inside source details. However read_dlt_delta tries to read "database" instead.
@CLAassistant
Copy link

CLAassistant commented Jan 19, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@ravi-databricks ravi-databricks left a comment

Choose a reason for hiding this comment

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

LGTM

@ravi-databricks
Copy link
Contributor

Please fix Unit Tests

@@ -62,14 +62,14 @@ def read_dlt_delta(spark, bronze_dataflow_spec) -> DataFrame:
if reader_config_options and len(reader_config_options) > 0:
return (
spark.readStream.options(**reader_config_options).table(
f"""{bronze_dataflow_spec.sourceDetails["database"]}
f"""{bronze_dataflow_spec.sourceDetails["source_database"]}

Choose a reason for hiding this comment

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

Can we introduce a variable, say source_table for the value and use it in these two places (so it's clear(er) that they're the same)? 🙏

@prabhat-ratnala
Copy link

Can this be resolved please?

fixed unit tests for changing keys in delta pipeline reader
@ravi-databricks ravi-databricks merged commit 3555aaa into databrickslabs:main Apr 15, 2024
2 of 3 checks passed
@ravi-databricks
Copy link
Contributor

merged this for v0.0.7 release.

@ravi-databricks
Copy link
Contributor

@prabhat-ratnala this is fixed in release v.0.0.7

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.

5 participants