-
Notifications
You must be signed in to change notification settings - Fork 238
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
base: devel
Are you sure you want to change the base?
adds condition to check XDG_DATA_HOME to set global_dir value #2361
Conversation
✅ Deploy Preview for dlt-hub-docs canceled.
|
There was a problem hiding this 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
For the test, for now I have this test passing in def test_context_with_xdg_dir() -> None:
import tempfile
temp_data_home = os.path.join(tempfile.gettempdir(), "test")
os.environ["XDG_DATA_HOME"] = temp_data_home
ctx = PluggableRunContext()
run_context = ctx.context
assert run_context.global_dir == os.path.join(temp_data_home, "dlt")
os.environ.pop("XDG_DATA_HOME") As for the failing CI above, it seems I have to do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@goosethedev are you planning to still work on this? to complete the PR we need to:
- fix the KeyError
- add a test that you mentioned in PR. just unit testing
global_dir
is also good.test_run_context.py
is the right place~ - merge the current devel... we fixed a few tests that stopped working recently (outdated test rest API)
thanks!
ec8f5e8
to
2aa8880
Compare
Sorry for the delay, I was waiting for feedback on the test 😅 I decided to force-push to incorporate the new changes from |
2aa8880
to
9ba4871
Compare
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