-
Notifications
You must be signed in to change notification settings - Fork 10
feat: introduce waiting for enough free space on local storage; require passing the logger to the storage provider #68
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
Conversation
📝 WalkthroughWalkthroughThe changes update documentation and integrate logging into the storage system. The README now explains how the Changes
Sequence Diagram(s)sequenceDiagram
participant T as Test Suite
participant TP as _get_provider
participant SP as StorageProviderBase
participant LG as Logger
T->>T: Create logger instance
T->>TP: Call _get_provider(tmp_path, logger)
TP->>SP: Instantiate StorageProviderBase with logger
SP->>SP: Assign logger to self.logger
SP-->>TP: Return provider instance
TP-->>T: Provider instance returned
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 2
🧹 Nitpick comments (3)
snakemake_interface_storage_plugins/common.py (1)
24-25: Extra blank lines detected.Consider removing these additional blank lines if they are not intentional for visual clarity.
- -snakemake_interface_storage_plugins/storage_object.py (2)
139-139: Trailing whitespace found.Remove trailing whitespace to fix pipeline failure (W291). For instance:
🧰 Tools
🪛 GitHub Actions: CI
[warning] 139-139: W291 trailing whitespace
221-223: Line too long.Wrap the lines to address pipeline failures (E501):
+ wait_time_step is not None + and waited < wait_time + and size > disk_free + ): + f"Waiting {format_timespan(wait_time_step)} for enough free space " + f"to " + )🧰 Tools
🪛 GitHub Actions: CI
[error] 221-221: E501 line too long (89 > 88 characters)
[error] 223-223: E501 line too long (90 > 88 characters)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pyproject.tomlis excluded by!pyproject.toml
📒 Files selected for processing (3)
snakemake_interface_storage_plugins/common.py(2 hunks)snakemake_interface_storage_plugins/storage_object.py(5 hunks)snakemake_interface_storage_plugins/storage_provider.py(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.py`: Do not try to improve formatting. Do not suggest type annotations for functions that are defined inside of functions or methods. Do not suggest type annotation of the `s...
**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of theselfargument of methods.
Do not suggest type annotation of theclsargument of classmethods.
Do not suggest return type annotation if a function or method does not contain areturnstatement.
snakemake_interface_storage_plugins/common.pysnakemake_interface_storage_plugins/storage_provider.pysnakemake_interface_storage_plugins/storage_object.py
🧬 Code Definitions (2)
snakemake_interface_storage_plugins/storage_provider.py (1)
snakemake_interface_storage_plugins/settings.py (1) (1)
StorageProviderSettingsBase(14:30)
snakemake_interface_storage_plugins/storage_object.py (2)
snakemake_interface_storage_plugins/common.py (2) (2)
Operation(16:23)get_disk_free(26:31)snakemake_interface_storage_plugins/io.py (1) (1)
size(93:93)
🪛 GitHub Actions: CI
snakemake_interface_storage_plugins/common.py
[warning] 31-31: W292 no newline at end of file
snakemake_interface_storage_plugins/storage_provider.py
[error] 191-191: TypeError: Can't instantiate abstract class StorageObject with abstract method local_footprint
snakemake_interface_storage_plugins/storage_object.py
[warning] 139-139: W291 trailing whitespace
[error] 221-221: E501 line too long (89 > 88 characters)
[error] 223-223: E501 line too long (90 > 88 characters)
🪛 Ruff (0.8.2)
snakemake_interface_storage_plugins/storage_object.py
200-203: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
🔇 Additional comments (5)
snakemake_interface_storage_plugins/common.py (2)
8-9: Imports look good.
26-31: Functionality is straightforward and efficient.The logic of climbing up the directory hierarchy before calling
shutil.disk_usageaccurately ensures correct partition usage.🧰 Tools
🪛 GitHub Actions: CI
[warning] 31-31: W292 no newline at end of file
snakemake_interface_storage_plugins/storage_provider.py (1)
61-69: New logger and wait parameter look good.Please verify existing tests are updated to include these constructor parameters. If not, consider adding a test ensuring
loggeris properly utilized andwait_for_free_local_storageis handled.snakemake_interface_storage_plugins/storage_object.py (2)
140-142: Well-documented method signature.The docstring clarifies behavior for directories. This is helpful for consumer code to understand return values.
143-149: Local footprint fallback is logically sound.Using
self.size()as a default respects older implementations. Good backward compatibility approach.
| # this ensures that the disk usage is calculated for the correct partition | ||
| while not local_path.exists(): | ||
| local_path = local_path.parent | ||
| return shutil.disk_usage(local_path).free No newline at end of file |
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.
Missing newline at end of file.
Add a newline to address pipeline failure (W292):
+ return shutil.disk_usage(local_path).free
+📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| return shutil.disk_usage(local_path).free | |
| return shutil.disk_usage(local_path).free | |
🧰 Tools
🪛 GitHub Actions: CI
[warning] 31-31: W292 no newline at end of file
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.
Actionable comments posted: 0
🧹 Nitpick comments (3)
snakemake_interface_storage_plugins/storage_object.py (3)
212-216: Validate wait_time early to prevent unnecessary operations.The validation of wait_time happens after retrieving the object size and checking free disk space. Consider moving this validation to the beginning of the method to fail fast if the configuration is invalid.
async def wait_for_free_space(self): """Wait for free space on the disk.""" + wait_time = self.provider.wait_for_free_local_storage + if wait_time is not None and wait_time < 1: + raise WorkflowError( + "Wait time for free space on local storage has to be at least " + "1 second or unset." + ) + size = await self.managed_local_footprint() disk_free = get_disk_free(self.local_path()) - wait_time = self.provider.wait_for_free_local_storage - - if wait_time is not None: - if wait_time < 1: - raise WorkflowError( - "Wait time for free space on local storage has to be at least " - "1 second or unset." - ) + if wait_time is not None: wait_time_step = 60 if wait_time > 60 else 1
219-220: Incorrect loop condition logic.The loop condition
wait_time_step is not Noneis redundant since wait_time_step is always assigned a value right before the loop. Additionally, the condition might be clearer with just the time and space checks.- while wait_time_step is not None and waited < wait_time and size > disk_free: + while waited < wait_time and size > disk_free:
230-236: Provide more actionable error message when disk space is insufficient.The error message could be more helpful by suggesting actions the user could take when disk space is insufficient.
if size > disk_free: raise WorkflowError( f"Cannot store {self.local_path()} " f"({format_size(size)} > {format_size(disk_free)}), " f"waited {format_timespan(self.provider.wait_for_free_local_storage)} " - "for more space." + "for more space. Consider freeing up disk space or increasing the " + "wait_for_free_local_storage setting if the space will become " + "available later." )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
snakemake_interface_storage_plugins/storage_object.py(5 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.py`: Do not try to improve formatting. Do not suggest type annotations for functions that are defined inside of functions or methods. Do not suggest type annotation of the `s...
**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of theselfargument of methods.
Do not suggest type annotation of theclsargument of classmethods.
Do not suggest return type annotation if a function or method does not contain areturnstatement.
snakemake_interface_storage_plugins/storage_object.py
🧬 Code Definitions (1)
snakemake_interface_storage_plugins/storage_object.py (2)
snakemake_interface_storage_plugins/common.py (2) (2)
Operation(16:23)get_disk_free(26:31)snakemake_interface_storage_plugins/io.py (1) (1)
size(93:93)
🪛 Ruff (0.8.2)
snakemake_interface_storage_plugins/storage_object.py
199-202: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: testing
🔇 Additional comments (8)
snakemake_interface_storage_plugins/storage_object.py (8)
6-6: Good addition of asyncio for async methods.The addition of asyncio is appropriate for the new async methods, particularly for the sleep functionality used in the wait_for_free_space method.
15-15: Appropriate import for human-friendly formatting.The humanfriendly library is well-suited for formatting sizes and time spans in log messages, making them more readable for users.
20-20: Good import of the get_disk_free function.Correctly importing the get_disk_free function from common.py, which is used in the wait_for_free_space method.
139-141: Clear documentation for the size method.Good addition of a docstring that clarifies the method should return size in bytes and specifies behavior for directories.
143-148: Good implementation of the local_footprint method with backward compatibility.The method provides a clear API for determining the local disk footprint of objects, while maintaining backward compatibility by defaulting to self.size().
177-177: Good addition of disk space check before retrieval.Adding a call to wait_for_free_space ensures there's sufficient disk space before attempting to retrieve an object, which helps prevent failed retrievals due to disk space constraints.
194-203: Use exception chaining while raising.To distinguish this failure from errors in exception handling, apply the exception chaining pattern:
- raise WorkflowError( - f"Failed to get expected local footprint (i.e. size) " - f"of {self.print_query}", e - ) + raise WorkflowError( + f"Failed to get expected local footprint (i.e. size) " + f"of {self.print_query}" + ) from e🧰 Tools
🪛 Ruff (0.8.2)
199-202: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
204-237: Good implementation of the wait_for_free_space method.The method properly:
- Checks available disk space against required size
- Implements a configurable wait mechanism
- Provides clear log messages with human-readable sizes and time spans
- Raises appropriate errors with informative messages
This approach to handling disk space constraints is robust and user-friendly.
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
snakemake_interface_storage_plugins/storage_object.py (1)
203-238: Fix line length in the logging statement.The implementation of waiting for free space is well-structured and provides good user feedback through logging. The wait time parameters are validated, and appropriate error messages are provided.
Line 223 exceeds the character limit (90 > 88 characters). Please shorten it:
- self.provider.logger.info( - f"Waiting {format_timespan(wait_time_step)} for enough free space to " - f"store {self.local_path()} " - f"({format_size(size)} > {format_size(disk_free)})" - ) + self.provider.logger.info( + f"Waiting {format_timespan(wait_time_step)} for enough free space to" + f" store {self.local_path()} " + f"({format_size(size)} > {format_size(disk_free)})" + )🧰 Tools
🪛 GitHub Actions: CI
[error] 223-223: E501 line too long (90 > 88 characters)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
snakemake_interface_storage_plugins/storage_object.py(6 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.py`: Do not try to improve formatting. Do not suggest type annotations for functions that are defined inside of functions or methods. Do not suggest type annotation of the `s...
**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of theselfargument of methods.
Do not suggest type annotation of theclsargument of classmethods.
Do not suggest return type annotation if a function or method does not contain areturnstatement.
snakemake_interface_storage_plugins/storage_object.py
🧠 Learnings (1)
snakemake_interface_storage_plugins/storage_object.py (1)
Learnt from: johanneskoester
PR: snakemake/snakemake-interface-storage-plugins#68
File: snakemake_interface_storage_plugins/storage_object.py:194-203
Timestamp: 2025-03-18T14:04:45.477Z
Learning: The project prefers passing exceptions as a second argument to WorkflowError constructor (e.g., `raise WorkflowError("message", e)`) rather than using Python's exception chaining syntax (`raise WorkflowError("message") from e`). Do not suggest changing to the `from e` pattern even if linters like Ruff flag it with B904.
🧬 Code Definitions (1)
snakemake_interface_storage_plugins/storage_object.py (2)
snakemake_interface_storage_plugins/common.py (2) (2)
Operation(16:23)get_disk_free(26:31)snakemake_interface_storage_plugins/io.py (1) (1)
size(93:93)
🪛 Ruff (0.8.2)
snakemake_interface_storage_plugins/storage_object.py
172-172: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
197-201: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
286-286: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
🪛 GitHub Actions: CI
snakemake_interface_storage_plugins/storage_object.py
[error] 223-223: E501 line too long (90 > 88 characters)
🔇 Additional comments (6)
snakemake_interface_storage_plugins/storage_object.py (6)
139-141: Enhanced documentation with clear return expectation.The added docstring clearly describes that the method should return the size in bytes and specifies the expectation for directories (return 0). This improves code readability and maintainability.
143-148: Good addition of the local_footprint method.This method provides a clear distinction between the logical size of an object and its actual footprint on disk. The default implementation maintains backward compatibility by returning
self.size(), which is a good practice for API evolution.
175-175: LGTM: Disk space verification before retrieval.Adding a call to
wait_for_free_spacebefore attempting to retrieve an object is a sensible enhancement that prevents failures due to insufficient disk space.
192-201: LGTM: Good error handling for local footprint operations.The managed method for local footprint follows the established pattern in the codebase for other operations. The error message is clear and helpful for debugging.
🧰 Tools
🪛 Ruff (0.8.2)
197-201: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
197-201: Note about exception handling pattern.The project's preferred exception handling style is correctly implemented here. Keeping it consistent with the rest of the codebase.
🧰 Tools
🪛 Ruff (0.8.2)
197-201: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
209-217: LGTM: Good validation of wait time parameter.The code properly validates that the wait time is at least 1 second, providing a clear error message if the condition is not met. The step calculation is sensible, using smaller steps for short waits and larger steps for longer waits.
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.
Actionable comments posted: 0
🧹 Nitpick comments (3)
snakemake_interface_storage_plugins/storage_object.py (3)
203-238: Consider adding buffer for free space requirement.The implementation correctly waits for free space based on the provider's configuration. However, it only checks if
size > disk_freewithout any buffer, which could lead to issues if other processes are also writing to disk.Consider modifying to add a small buffer (e.g., 5-10%) to ensure there's enough headroom:
- if size > disk_free: + # Add a 10% buffer to ensure we have enough space + required_space = int(size * 1.1) + if required_space > disk_free: raise WorkflowError( - f"Cannot store {self.local_path()} " - f"({format_size(size)} > {format_size(disk_free)}), " + f"Cannot store {self.local_path()} " + f"({format_size(size)}, need {format_size(required_space)} with buffer > {format_size(disk_free)}), " f"waited {format_timespan(self.provider.wait_for_free_local_storage)} " "for more space." )
217-217: Consider a more gradual waiting strategy.The current implementation jumps from a 1-second wait to a 60-second wait depending on the total wait time. A more gradual approach might provide a better user experience.
- wait_time_step = 60 if wait_time > 60 else 1 + # More gradual wait time steps based on total wait time + if wait_time <= 10: + wait_time_step = 1 + elif wait_time <= 120: + wait_time_step = 10 + else: + wait_time_step = 60
235-235: Clarify actual wait time in error message.The error message states the configured wait time, but the actual time waited might be less if the loop exited early. Using the
waitedvariable would be more accurate.- f"waited {format_timespan(self.provider.wait_for_free_local_storage)} " + f"waited up to {format_timespan(waited)} "
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
snakemake_interface_storage_plugins/storage_object.py(6 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.py`: Do not try to improve formatting. Do not suggest type annotations for functions that are defined inside of functions or methods. Do not suggest type annotation of the `s...
**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of theselfargument of methods.
Do not suggest type annotation of theclsargument of classmethods.
Do not suggest return type annotation if a function or method does not contain areturnstatement.
snakemake_interface_storage_plugins/storage_object.py
🧠 Learnings (1)
snakemake_interface_storage_plugins/storage_object.py (1)
Learnt from: johanneskoester
PR: snakemake/snakemake-interface-storage-plugins#68
File: snakemake_interface_storage_plugins/storage_object.py:194-203
Timestamp: 2025-03-18T14:04:45.477Z
Learning: The project prefers passing exceptions as a second argument to WorkflowError constructor (e.g., `raise WorkflowError("message", e)`) rather than using Python's exception chaining syntax (`raise WorkflowError("message") from e`). Do not suggest changing to the `from e` pattern even if linters like Ruff flag it with B904.
🪛 Ruff (0.8.2)
snakemake_interface_storage_plugins/storage_object.py
172-172: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
197-201: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
286-286: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
🔇 Additional comments (5)
snakemake_interface_storage_plugins/storage_object.py (5)
139-141: Good enhancement with added docstring.Adding a clear docstring to the
size()method helps clarify its expected behavior, especially the note about directories returning 0.
143-148: Well-designed addition of local_footprint method.This method nicely extends the API to differentiate between remote object size and actual local disk footprint, which is crucial for disk space management. The backward compatibility approach through defaulting to
self.size()is a good practice.
175-175: Good addition to check for space before retrieval.Adding the
wait_for_free_space()call ensures we don't attempt to retrieve files when there's insufficient disk space, which could prevent partial downloads and subsequent cleanup operations.
192-201: Properly implemented managed method for local_footprint.This follows the established pattern for managed methods, correctly implementing rate limiting and error handling consistent with other methods in the class.
🧰 Tools
🪛 Ruff (0.8.2)
197-201: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
197-201: Maintain consistent exception handling style.The project's preferred exception handling style is correctly used here (
raise WorkflowError("message", e)), consistent with the team's preference noted in the learnings.🧰 Tools
🪛 Ruff (0.8.2)
197-201: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
snakemake_interface_storage_plugins/storage_object.py (1)
203-236: Consider handling edge cases in wait_for_free_spaceThe implementation handles waiting for free space well, with good logging and error messages. Consider two small improvements:
- The error message when
wait_timeis None might be confusing as it mentions waiting for a specific time that wasn't actually set.- Consider adding a special case when
sizeis 0 to skip the waiting logic entirely.async def wait_for_free_space(self): """Wait for free space on the disk.""" size = await self.managed_local_footprint() disk_free = get_disk_free(self.local_path()) + # Skip waiting if no space is needed + if size == 0: + return + wait_time = self.provider.wait_for_free_local_storage if wait_time is not None: if wait_time < 1: raise WorkflowError( "Wait time for free space on local storage has to be at least " "1 second or unset." ) wait_time_step = 60 if wait_time > 60 else 1 waited = 0 while waited < wait_time and size > disk_free: self.provider.logger.info( f"Waiting {format_timespan(wait_time_step)} for enough free " f"space to store {self.local_path()} " f"({format_size(size)} > {format_size(disk_free)})" ) await asyncio.sleep(wait_time_step) waited += wait_time_step disk_free = get_disk_free(self.local_path()) if size > disk_free: raise WorkflowError( f"Cannot store {self.local_path()} " f"({format_size(size)} > {format_size(disk_free)})" - f", waited {format_timespan(self.provider.wait_for_free_local_storage)} " - "for more space." + f"{', waited ' + format_timespan(waited) + ' for more space' if wait_time is not None else '.'}" )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
snakemake_interface_storage_plugins/storage_object.py(6 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.py`: Do not try to improve formatting. Do not suggest type annotations for functions that are defined inside of functions or methods. Do not suggest type annotation of the `s...
**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of theselfargument of methods.
Do not suggest type annotation of theclsargument of classmethods.
Do not suggest return type annotation if a function or method does not contain areturnstatement.
snakemake_interface_storage_plugins/storage_object.py
🧠 Learnings (1)
snakemake_interface_storage_plugins/storage_object.py (1)
Learnt from: johanneskoester
PR: snakemake/snakemake-interface-storage-plugins#68
File: snakemake_interface_storage_plugins/storage_object.py:194-203
Timestamp: 2025-03-18T14:04:45.477Z
Learning: The project prefers passing exceptions as a second argument to WorkflowError constructor (e.g., `raise WorkflowError("message", e)`) rather than using Python's exception chaining syntax (`raise WorkflowError("message") from e`). Do not suggest changing to the `from e` pattern even if linters like Ruff flag it with B904.
🪛 Ruff (0.8.2)
snakemake_interface_storage_plugins/storage_object.py
172-172: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
197-201: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
284-284: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
🔇 Additional comments (5)
snakemake_interface_storage_plugins/storage_object.py (5)
139-141: Good documentation additionThe docstring clarifies that the method should return the object's size in bytes and explicitly states that directories should return 0, which helps implementers understand the expected behavior.
143-148: Good implementation of local footprint methodThe
local_footprintmethod is a well-designed addition with clear documentation explaining the difference between object size and local footprint. The default implementation maintains backward compatibility by falling back toself.size().
174-175: Good integration of space checking before retrievalAdding the wait for free space check before retrieval is a good practice to prevent failed retrievals due to disk space limitations.
192-201: Well-implemented managed method for local footprintThis method follows the established pattern of other managed methods in the class, providing consistent error handling and rate limiting.
🧰 Tools
🪛 Ruff (0.8.2)
197-201: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
197-201: Exception handling follows project conventionsThe code correctly uses the project's preferred exception handling pattern (passing the original exception as a second argument) instead of Python's exception chaining syntax.
🧰 Tools
🪛 Ruff (0.8.2)
197-201: Within an
exceptclause, raise exceptions withraise ... from errorraise ... from Noneto distinguish them from errors in exception handling(B904)
Summary by CodeRabbit
README.mdwith detailed explanations regarding logging capabilities and provider access.