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

Corrected delta reader key from table to source_table #54

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/pipeline_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ def read_dlt_delta(spark, bronze_dataflow_spec) -> DataFrame:
return (
spark.readStream.options(**reader_config_options).table(
f"""{bronze_dataflow_spec.sourceDetails["source_database"]}
.{bronze_dataflow_spec.sourceDetails["table"]}"""
.{bronze_dataflow_spec.sourceDetails["source_table"]}"""
)
)
else:
return (
spark.readStream.table(
f"""{bronze_dataflow_spec.sourceDetails["source_database"]}
.{bronze_dataflow_spec.sourceDetails["table"]}"""
.{bronze_dataflow_spec.sourceDetails["source_table"]}"""
)
)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_pipeline_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def test_read_delta_positive(self):
full_path = os.path.abspath("tests/resources/delta/customers")
self.spark.sql(f"CREATE TABLE if not exists source_bronze.customer USING DELTA LOCATION '{full_path}' ")

source_details_map = {"sourceDetails": {"source_database": "source_bronze", "table": "customer"}}
source_details_map = {"sourceDetails": {"source_database": "source_bronze", "source_table": "customer"}}

bronze_map.update(source_details_map)
bronze_dataflow_spec = BronzeDataflowSpec(**bronze_map)
Expand All @@ -227,7 +227,7 @@ def test_read_delta_with_read_config_positive(self):
self.spark.sql("CREATE DATABASE IF NOT EXISTS source_bronze")
full_path = os.path.abspath("tests/resources/delta/customers")
self.spark.sql(f"CREATE TABLE if not exists source_bronze.customer USING DELTA LOCATION '{full_path}' ")
source_details_map = {"sourceDetails": {"source_database": "source_bronze", "table": "customer"}}
source_details_map = {"sourceDetails": {"source_database": "source_bronze", "source_table": "customer"}}
bronze_map.update(source_details_map)
reader_config = {"readerConfigOptions": {"maxFilesPerTrigger": "1"}}
bronze_map.update(reader_config)
Expand Down
Loading