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

Use entire tenant domain name in dbt Cloud connection #855

Merged
merged 1 commit into from Jan 24, 2023

Conversation

josh-fell
Copy link
Contributor

Related: apache/airflow#27146 apache/airflow#28890

In OSS Airflow, the dbt Cloud connection has replaced schema for host to provide the "tenant" name. This fix was included in the latest version of the dbt Cloud provider (2.3.1) and should also be reflected in this provider.

Related: apache/airflow#27146 apache/airflow#28890

In OSS Airflow, the dbt Cloud connection has replaced `schema` for `host` to provide the "tenant" name. This fix was included in the latest version of the dbt Cloud provider (2.3.1) and should also be reflected in this provider.
if base_url and not base_url.endswith("/") and endpoint and not endpoint.startswith("/"):
url = base_url + "/" + endpoint
else:
url = (base_url or "") + (endpoint or "")
Copy link
Contributor Author

@josh-fell josh-fell Jan 23, 2023

Choose a reason for hiding this comment

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

Removed the if/else since this line would never be executed.

@codecov
Copy link

codecov bot commented Jan 23, 2023

Codecov Report

Base: 98.61% // Head: 98.63% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (7c1e1dd) compared to base (97f0509).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #855      +/-   ##
==========================================
+ Coverage   98.61%   98.63%   +0.02%     
==========================================
  Files          89       89              
  Lines        4970     4972       +2     
==========================================
+ Hits         4901     4904       +3     
+ Misses         69       68       -1     
Impacted Files Coverage Δ
astronomer/providers/dbt/cloud/hooks/dbt.py 100.00% <100.00%> (+1.35%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@josh-fell
Copy link
Contributor Author

If the fix here is acceptable, I can add it to OSS Airflow as well. Although there is probably some other refactoring that could be done (i.e. a shared function between the Async and sync versions).

@phanikumv phanikumv merged commit fc5b37a into astronomer:main Jan 24, 2023
@josh-fell josh-fell deleted the dbt-cloud-tenant branch January 24, 2023 16:55
@phanikumv phanikumv added this to the 1.15.0 milestone Feb 8, 2023
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.

None yet

4 participants