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

Ensure safer profile mappings by removing __getattr__ #407

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

jlaneve
Copy link
Collaborator

@jlaneve jlaneve commented Jul 27, 2023

Description

Before, profile mappings would override __getattr__ to get the dbt profile value, primarily for convenience. However, this was causing unintended side effects - infinite recursive loops. This PR fixes the issue by removing the __getattr__ override in favor of being more explicit.

Related Issue(s)

Breaking Change?

No, this is all behind-the-scenes.

Checklist

  • I have made corresponding changes to the documentation (if required)
  • I have added tests that prove my fix is effective or that my feature works

@jlaneve jlaneve requested a review from a team as a code owner July 27, 2023 17:08
@jlaneve jlaneve requested a review from a team July 27, 2023 17:08
@netlify
Copy link

netlify bot commented Jul 27, 2023

👷 Deploy Preview for amazing-pothos-a3bca0 processing.

Name Link
🔨 Latest commit c7e1da1
🔍 Latest deploy log https://app.netlify.com/sites/amazing-pothos-a3bca0/deploys/64c2a4959621430008529159

@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.10% 🎉

Comparison is base (5352d69) 91.25% compared to head (c7e1da1) 91.35%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #407      +/-   ##
==========================================
+ Coverage   91.25%   91.35%   +0.10%     
==========================================
  Files          48       48              
  Lines        1692     1689       -3     
==========================================
- Hits         1544     1543       -1     
+ Misses        148      146       -2     
Files Changed Coverage Δ
cosmos/profiles/bigquery/service_account_file.py 100.00% <ø> (ø)
.../profiles/bigquery/service_account_keyfile_dict.py 100.00% <ø> (ø)
cosmos/profiles/databricks/token.py 100.00% <ø> (ø)
cosmos/profiles/exasol/user_pass.py 100.00% <ø> (ø)
cosmos/profiles/postgres/user_pass.py 100.00% <ø> (ø)
cosmos/profiles/redshift/user_pass.py 100.00% <ø> (ø)
cosmos/profiles/snowflake/user_pass.py 96.42% <ø> (ø)
cosmos/profiles/snowflake/user_privatekey.py 96.55% <ø> (ø)
cosmos/profiles/spark/thrift.py 100.00% <ø> (ø)
cosmos/profiles/trino/certificate.py 100.00% <ø> (ø)
... and 3 more

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

Copy link
Contributor

@harels harels left a comment

Choose a reason for hiding this comment

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

Approved, pending integration tests passing

@jlaneve jlaneve merged commit 89963ab into main Jul 27, 2023
39 checks passed
@jlaneve jlaneve deleted the safer-profile-mappings branch July 27, 2023 17:23
tatiana pushed a commit that referenced this pull request Aug 9, 2023
## Description

<!-- Add a brief but complete description of the change. -->

Before, profile mappings would override `__getattr__` to get the dbt
profile value, primarily for convenience. However, this was causing
unintended side effects - infinite recursive loops. This PR fixes the
issue by removing the `__getattr__` override in favor of being more
explicit.

## Related Issue(s)

<!-- If this PR closes an issue, you can use a keyword to auto-close.
-->
<!-- i.e. "closes #0000" -->

## Breaking Change?

<!-- If this introduces a breaking change, specify that here. -->

No, this is all behind-the-scenes.

## Checklist

- [ ] I have made corresponding changes to the documentation (if
required)
- [ ] I have added tests that prove my fix is effective or that my
feature works
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.

2 participants