Skip to content

Use a sensible default for DuckDB when the environment does not set $HOME - #74126

Closed
ferruzzi wants to merge 1 commit into
apache:mainfrom
aws-mwaa:ferruzzi/system-tests/fix-duck-on-lambda
Closed

ferruzzi wants to merge 1 commit into
apache:mainfrom
aws-mwaa:ferruzzi/system-tests/fix-duck-on-lambda

Conversation

@ferruzzi

@ferruzzi ferruzzi commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

DuckDB defaults to using $HOME for files, but serverless environments don't always set that. When that value is not available, we'll use a default.

Specifically noticed this when the DuckDB system, tests failed on Lambda Executor, but should apply to other serverless environments and maybe some other non-standard installations that don't set $HOME. If $HOME isn't set, then fall back on a temp file.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

…HOME.

DuckDB defaults to using $HOME for files, but serverless environments don't always set that.  When that value is not available, we'll use a default.
@vincbeck

vincbeck commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

One test is failing

@o-nikolas o-nikolas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd actually argue this is the responsibility of the admin to configure these environments with a HOME directory. I had planned to configure that as part of our CDK configuration for the Lambda executor, but it must have gotten dropped in the flurry of CRs I put together

@ferruzzi

ferruzzi commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

I actually looked into this a little more based on the CI failure and I think my solution only works on Duck 1.5.0+, which is another argument against this fix; we'd at least have to gate it behind a version check AND still add the requirements to the docs (and fix the CDK for the system test runner on the AWS side) either way. Before 1.5 the home_directory wasn't accepted as a config-time config option (hence the CI failure) and there is a bug report on 1.3.2 saying it didn't actually work back then.

So this fix would/could only work in 1.5.0+, we'd either need a more robust fix (like using SET home_directory='...' after connecting, maybe? untested, but I think that's the next thing I would try) or use this fix behind a version check and bump minver.

But based on Niko's comment, I'll close this PR and put up a new one this afternoon which just adds some docs and makes it explicit that this is an environment requirement. We can revisit if we want to add this later, gate it behind a proper Duck version check, etc, but the docs should be updated either way and would be universal instead of only fixing latest.

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.

3 participants