Skip to content

Ensure settings$database defaults to NULL when absent#3714

Merged
mdietze merged 2 commits intoPecanProject:developfrom
AritraDey-Dev:fix-db-default-null
Dec 10, 2025
Merged

Ensure settings$database defaults to NULL when absent#3714
mdietze merged 2 commits intoPecanProject:developfrom
AritraDey-Dev:fix-db-default-null

Conversation

@AritraDey-Dev
Copy link
Member

Description

Currently, both Demo notebooks use a workaround to set settings$database to NULL, even though the configuration is absent in the settings file.

1. Disabling database write operations because we are not using a database
```{r disable-db-write}
settings$database <- NULL # Disable database operations for this demo

The issue arises because prepare.settings automatically adds settings$database$dbfiles even if settings$database is initially absent. (see #3701 (comment)).

This PR fixes the issue by modifying check.settings to only set settings$database$dbfiles if settings$database is already present (i.e., not NULL). This ensures that settings$database remains NULL when no database configuration is provided.
Also, after the fix, inspecting the settings object confirms that there is NO settings$database present.

Motivation and Context

Fixes #3701

Review Time Estimate

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • My name is in the list of CITATION.cff
  • I agree that PEcAn Project may distribute my contribution under any or all of
    • the same license as the existing code,
    • and/or the BSD 3-clause license.
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Signed-off-by: Aritra Dey <adey01027@gmail.com>
Signed-off-by: Aritra Dey <adey01027@gmail.com>
@AritraDey-Dev AritraDey-Dev changed the title Fix: Ensure settings$database defaults to NULL when absent Ensure settings$database defaults to NULL when absent Dec 10, 2025
@mdietze mdietze added this pull request to the merge queue Dec 10, 2025
Merged via the queue into PecanProject:develop with commit 09ea6c9 Dec 10, 2025
19 of 26 checks passed
@AritraDey-Dev AritraDey-Dev deleted the fix-db-default-null branch December 10, 2025 15:40
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.

Database settings should default to NULL when <database> is absent

2 participants