Skip to content

Fix lazy loading when using pathlib.Path and resolve test failures#347

Merged
dschwoerer merged 14 commits intomasterfrom
pr-345-346
Apr 28, 2026
Merged

Fix lazy loading when using pathlib.Path and resolve test failures#347
dschwoerer merged 14 commits intomasterfrom
pr-345-346

Conversation

@dschwoerer
Copy link
Copy Markdown
Contributor

No description provided.

mikekryjak and others added 14 commits April 17, 2026 13:18
The path check assumed the path was a string, which would make the dataset load in a non-lazy way if the path was pathlib.Path
The "squashed" dataset is quite different from a real, squashed dataset.
Likely a real one would not work either.
Not doing results in random warnings of unclosed files, and might also
cause dead-locks
@dschwoerer
Copy link
Copy Markdown
Contributor Author

I think this is the summary of the relevant changes:

  • accept Pathlib path with lazy_load by @mikekryjak
  • ensure dz is in the variable section
  • ensure dz is not in the metadata section
  • enable dropping vars with lazy loading
  • give a helpful error when failing to open a squashed double null config
  • do not attempt to lazy open a squashed double null config in tests

This should further align lazy_load to the legacy load where reasonable possible, and give a clear error where not.

Copy link
Copy Markdown
Collaborator

@mikekryjak mikekryjak left a comment

Choose a reason for hiding this comment

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

Excellent work, @dschwoerer. I appreciate it!

@dschwoerer dschwoerer merged commit 8bccd37 into master Apr 28, 2026
11 checks passed
@dschwoerer dschwoerer deleted the pr-345-346 branch April 28, 2026 10:10
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.

2 participants