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

Allow to specify source database instead of defaulting to bronze database in __get_silver_dataflow_spec_dataframe #34

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rtdtwo
Copy link
Contributor

@rtdtwo rtdtwo commented Jan 22, 2024

Issue

The FAQs describes that any data source can be used for silver tables. However, the code always tries to find the bronze database from the onboarding rows, and there's no explicit mention of a source database other than a bronze database.

Fix

Change the code to accomplish the following:

  • Use bronze_database_{env} if the field is found in onboarding rows.
  • If not, find and use source_details.

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

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.

Please fix Linting errors

Copy link

codecov bot commented Jan 22, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (2a93dd9) 90.28% compared to head (f4fbd2b) 89.95%.

Files Patch % Lines
src/onboard_dataflowspec.py 40.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
- Coverage   90.28%   89.95%   -0.34%     
==========================================
  Files           8        8              
  Lines         803      806       +3     
  Branches      149      151       +2     
==========================================
  Hits          725      725              
- Misses         31       32       +1     
- Partials       47       49       +2     
Flag Coverage Δ
unittests 89.95% <40.00%> (-0.34%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ravi-databricks
Copy link
Contributor

@rtdtwo, Needs to add unit tests for added new lines as per above code coverage report.

}
if f"bronze_database_{env}" in onboarding_row:
source_details = {
"database": onboarding_row["bronze_database_{}".format(env)],

Choose a reason for hiding this comment

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

Why not use f"bronze_database_{env}" as in if above (which IMHO is more pythonic)?

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.

3 participants