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 external_access_integration and secret to python model impl #955

Conversation

Lindblomsebastian
Copy link
Contributor

@Lindblomsebastian Lindblomsebastian commented Mar 27, 2024

This resolves #925
docs: dbt-labs/docs.getdbt.com#5262

Problem

EXTERNAL_ACCESS_INTEGRATION and SECRETS are not populated in the generated PROC

Solution

Add EXTERNAL_ACCESS_INTEGRATION and SECRETS to the generated PROC if they are part of the config.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

Copy link

cla-bot bot commented Mar 27, 2024

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.

CLA has not been signed by users: @Lindblomsebastian

@Lindblomsebastian Lindblomsebastian force-pushed the external-access-integrations-and-secrets branch from 6d30a27 to 4a10155 Compare March 27, 2024 10:09
Copy link

cla-bot bot commented Mar 27, 2024

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.

CLA has not been signed by users: @Lindblomsebastian

@Lindblomsebastian
Copy link
Contributor Author

CLA has now been signed.

@cla-bot cla-bot bot added the cla:yes label Apr 2, 2024
@ernestoongaro ernestoongaro self-requested a review April 3, 2024 22:52
this is plural
Turns our secrets need to live in the schema in which they will be used and don't need to be run by ACCOUNTADMIN
httpx has no method called stats, it's status
@ernestoongaro
Copy link
Contributor

@Lindblomsebastian

I'm getting failures from the secrets test: dbt.log
invalid property 'SECRETS' for 'FUNCTION'

and as well for the external access integrations test: (adding extra quotes) dbt.log

  invalid value ''test_external_access_integration'' for property 'EXTERNAL_ACCESS_INTEGRATIONS'

@Lindblomsebastian
Copy link
Contributor Author

@Lindblomsebastian

I'm getting failures from the secrets test: dbt.log invalid property 'SECRETS' for 'FUNCTION'

and as well for the external access integrations test: (adding extra quotes) dbt.log

  invalid value ''test_external_access_integration'' for property 'EXTERNAL_ACCESS_INTEGRATIONS'

I missed that the secrets you specify as values must also be specified in the external access integration. (See https://docs.snowflake.com/en/developer-guide/external-network-access/creating-using-external-network-access#using-the-external-access-integration-in-a-function-or-procedure)
@colin-rogers-dbt, would you mind adding a secret named test_secret to the test_external_access_integration? I've included the SQL commands as comments in the test (See d1517b4#diff-47b9e84b411efd20b1b24f2f1e566455bc7f6dc21021bac6c160efcd76768a60R210-R216).

@ernestoongaro
Copy link
Contributor

@colin-rogers-dbt, would you mind adding a secret named test_secret to the test_external_access_integration?

i've done this today but due to the security integration needing to know the schema of the secret I can't quite get it to work so asked ❄️ for help

@ernestoongaro ernestoongaro self-requested a review April 10, 2024 23:32
Copy link
Contributor

@ernestoongaro ernestoongaro left a comment

Choose a reason for hiding this comment

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

Off to @colin-rogers-dbt for review now!

@colin-rogers-dbt colin-rogers-dbt merged commit 92a3fcf into dbt-labs:main Apr 11, 2024
50 checks passed
@dbeatty10 dbeatty10 added the user docs [docs.getdbt.com] Needs better documentation label Apr 11, 2024
@dbeatty10
Copy link
Contributor

Since this PR introduces a new user interface (model-level config for external_access_integrations), I've added the user docs label, and I'll ping our documentation team to make sure that they have it tracked.

cc: @dataders

@colin-rogers-dbt
Copy link
Contributor

Since this PR introduces a new user interface (model-level config for external_access_integrations), I've added the user docs label, and I'll ping our documentation team to make sure that they have it tracked.

cc: @dataders

Thanks @dbeatty10 !

@ernestoongaro
Copy link
Contributor

@dbeatty10 @colin-rogers-dbt - I have a PR for docs: dbt-labs/docs.getdbt.com#5262

mirnawong1 added a commit to dbt-labs/docs.getdbt.com that referenced this pull request Apr 12, 2024
… & secrets (Snowpark concept) (#5262)

## What are you changing in this pull request and why?
dbt-labs/dbt-snowflake#925
dbt-labs/dbt-snowflake#955

## Checklist
Wait until PR is merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes ok to test user docs [docs.getdbt.com] Needs better documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Implement EXTERNAL_ACCESS_INTEGRATIONS and secrets in submit_python_job
4 participants