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

Add ability to provide proxy for dbt Cloud connection #42737

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

b-per
Copy link
Contributor

@b-per b-per commented Oct 4, 2024

Adding the ability to define proxy settings when connecting to dbt Cloud. This can be useful for people setting up IP restrictions on dbt Cloud, allowing only some IPs to connect.

This is my first contribution to Airflow, so feel free to let me know if I need to do anything else.

I update the code for the hooks and added some documentation.

I didn't add tests as I am not too sure of how I could do it in that case, but I am happy to do so with a bit of pointers/guidance.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

Copy link

boring-cyborg bot commented Oct 4, 2024

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@potiuk
Copy link
Member

potiuk commented Oct 4, 2024

Needs unit tests.

@b-per
Copy link
Contributor Author

b-per commented Oct 5, 2024

Happy to add some, but I am not able run the existing ones. Hence why I was wondering if there was any pointer or guidance.

If I do a pytest tests/providers/dbt/cloud/ in my hatch env I get a ModuleNotFoundError: No module named 'sqlalchemy' but sqlalchemy is indeed installed

@b-per
Copy link
Contributor Author

b-per commented Oct 7, 2024

I actually managed to run the tests with breeze testing tests --test-type "Providers[dbt.cloud]".

I have updated them so that they pass again and I have added an extra test with the proxy.

Let me know if instead of creating a new test you prefer if I update all the pytest.mark.parametrize to include the connection with a proxy.

My rationale for adding a new test for the proxy rather than as a parameter for all tests is that most people using the providers won't need the proxy.

@b-per b-per force-pushed the feature/add-proxy-settings-dbt-cloud branch from 6f024f7 to c5afd71 Compare October 7, 2024 16:24
@potiuk
Copy link
Member

potiuk commented Oct 8, 2024

If I do a pytest tests/providers/dbt/cloud/ in my hatch env I get a ModuleNotFoundError: No module named 'sqlalchemy' but sqlalchemy is indeed installed

BTW. Re venv - you should be able to run the test in venv created with `pip install -e ".[dbt.cloud,devel-tests]" - that should install all what is needed to run the tests.

@potiuk potiuk merged commit c57be2f into apache:main Oct 8, 2024
56 checks passed
Copy link

boring-cyborg bot commented Oct 8, 2024

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

kaxil added a commit to astronomer/airflow that referenced this pull request Oct 8, 2024
Just simplified redundant code from apache#42737
kaxil added a commit that referenced this pull request Oct 8, 2024
kunaljubce pushed a commit to kunaljubce/airflow that referenced this pull request Oct 13, 2024
* Add ability to provide proxy for dbt Cloud connection

* Running pre-commit checks

* Update current tests and add new test with proxy
kunaljubce pushed a commit to kunaljubce/airflow that referenced this pull request Oct 13, 2024
pavansharma36 pushed a commit to pavansharma36/airflow that referenced this pull request Oct 14, 2024
* Add ability to provide proxy for dbt Cloud connection

* Running pre-commit checks

* Update current tests and add new test with proxy
pavansharma36 pushed a commit to pavansharma36/airflow that referenced this pull request Oct 14, 2024
R7L208 pushed a commit to R7L208/airflow that referenced this pull request Oct 17, 2024
joaopamaral pushed a commit to joaopamaral/airflow that referenced this pull request Oct 21, 2024
* Add ability to provide proxy for dbt Cloud connection

* Running pre-commit checks

* Update current tests and add new test with proxy
joaopamaral pushed a commit to joaopamaral/airflow that referenced this pull request Oct 21, 2024
harjeevanmaan pushed a commit to harjeevanmaan/airflow that referenced this pull request Oct 23, 2024
* Add ability to provide proxy for dbt Cloud connection

* Running pre-commit checks

* Update current tests and add new test with proxy
harjeevanmaan pushed a commit to harjeevanmaan/airflow that referenced this pull request Oct 23, 2024
ellisms pushed a commit to ellisms/airflow that referenced this pull request Nov 13, 2024
* Add ability to provide proxy for dbt Cloud connection

* Running pre-commit checks

* Update current tests and add new test with proxy
ellisms pushed a commit to ellisms/airflow that referenced this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants