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

duckdb filesystem custom secrets #2017

Open
wants to merge 12 commits into
base: devel
Choose a base branch
from

Conversation

sh-rp
Copy link
Collaborator

@sh-rp sh-rp commented Nov 3, 2024

Description

  • Use custom secrets location for fs tests
  • Warn the user if they use the default location when creating persistent secrets
  • Prevent persistent secrets for in memory database versions
  • Add some secrets tests

Note:
I tried implementing changing the secrets location in create_authentication, but somehow I could not get it right. I think this solution with warning the user should be good for now.

Copy link

netlify bot commented Nov 3, 2024

Deploy Preview for dlt-hub-docs canceled.

Name Link
🔨 Latest commit 6e8f65b
🔍 Latest deploy log https://app.netlify.com/sites/dlt-hub-docs/deploys/672a0dd7a84e260008be63d1

@sh-rp sh-rp changed the title [wip] duckdb filesystem custom secrets duckdb filesystem custom secrets Nov 4, 2024
@sh-rp sh-rp marked this pull request as ready for review November 4, 2024 08:55
).fetchone()[0]

# TODO: what is with windows?
is_default_secrets_directory = current_secret_directory.endswith("/.duckdb/stored_secrets")
Copy link
Collaborator

Choose a reason for hiding this comment

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

not going to work because windows use backslashes. ie.

D SELECT current_setting('secret_directory') AS secret_directory;
┌──────────────────────────────────────────┐
│             secret_directory             │
│                 varchar                  │
├──────────────────────────────────────────┤
│ C:\Users\rudolfix\.duckdb\stored_secrets │
└──────────────────────────────────────────┘

please use Path to compare paths

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

destinations_configs(all_buckets_filesystem_configs=True, bucket_subset=(AWS_BUCKET,)),
ids=lambda x: x.name,
)
def test_secrets_management(destination_config: DestinationTestConfiguration) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need this test in the load? if you move it to tests/pipelines it will execute on windows as well. then you'll see if you normalize the paths correctly

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

moved it

@sh-rp sh-rp force-pushed the fix/duckdb_filesystem_custom_secrets branch 2 times, most recently from 8f5d457 to a0828a9 Compare November 4, 2024 22:44
test secrets on all platforms
@sh-rp sh-rp force-pushed the fix/duckdb_filesystem_custom_secrets branch from a0828a9 to cd30eb8 Compare November 4, 2024 23:08
pytest.ini Outdated
@@ -1,7 +1,7 @@
[pytest]
pythonpath= dlt docs/website/docs
norecursedirs= .direnv .eggs build dist
addopts= -v --showlocals --durations 10
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok, somehow it does not work on ci...

@sh-rp sh-rp force-pushed the fix/duckdb_filesystem_custom_secrets branch from 5741abb to 40b8b80 Compare November 5, 2024 10:33
@@ -89,6 +89,7 @@ alembic = {version = ">1.10.0", optional = true}
paramiko = {version = ">=3.3.0", optional = true}
sqlglot = {version = ">=20.0.0", optional = true}
db-dtypes = { version = ">=1.2.0", optional = true }
aiohttp = { version = ">=3.9", optional = true }
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this seems to be needed for python 3.12

@sh-rp sh-rp requested a review from rudolfix November 5, 2024 17:51
@sh-rp sh-rp self-assigned this Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants