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

adds condition to check XDG_DATA_HOME to set global_dir value #2361

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

goosethedev
Copy link

Description

Check for XDG_DATA_HOME env var when setting the global directory for storing pipeline data.

If the variable if set but ~/.dlt exists, then it is used with a warning raised to move it manually and not break backwards compatibility.

Related Issues

Additional Context

Copy link

netlify bot commented Feb 28, 2025

Deploy Preview for dlt-hub-docs canceled.

Name Link
🔨 Latest commit ae5c493
🔍 Latest deploy log https://app.netlify.com/sites/dlt-hub-docs/deploys/67c23a016c679c000828f450

Copy link
Collaborator

@sh-rp sh-rp left a comment

Choose a reason for hiding this comment

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

thanks for the contribution :) I have one note, and it would be good to have a test for this. maybe in test_run_context.py

if not os.path.isdir(os.path.join(home, DOT_DLT)):
return os.path.join(os.environ["XDG_DATA_HOME"], "dlt")
else:
warnings.warn(
Copy link
Collaborator

Choose a reason for hiding this comment

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

we use logger.warning in our codebase, maybe use that instead

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.

Follow the XDG Base Directory spec for local pipelines' data
2 participants