feat: add postprocess_query method for optionally modifying the query before a storage object is created#51
Conversation
… before a storage object is created
WalkthroughThe recent updates introduce a new method, Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant StorageProvider
participant BaseClass
Client->>StorageProvider: Call object method with query
StorageProvider->>StorageProvider: Invoke postprocess_query(query)
StorageProvider->>BaseClass: Inherited functionality if no customization
StorageProvider->>Client: Return processed result
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (2)
- README.md (1 hunks)
- snakemake_interface_storage_plugins/storage_provider.py (2 hunks)
Additional context used
Path-based instructions (1)
snakemake_interface_storage_plugins/storage_provider.py (1)
Pattern
**/*.py: Do not suggest to add trailing commas for improving formatting.
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 explicitly return anything.
Ruff
snakemake_interface_storage_plugins/storage_provider.py
136-136: Missing type annotation for
selfin method(ANN101)
Additional comments not posted (3)
snakemake_interface_storage_plugins/storage_provider.py (2)
136-142: LGTM:postprocess_querymethod is well-designed for extensibility.The method provides a clear extension point for subclasses to customize query processing. The docstring is informative and guides subclass implementations effectively.
Tools
Ruff
136-136: Missing type annotation for
selfin method(ANN101)
168-168: LGTM: Integration ofpostprocess_queryenhances modularity.The
objectmethod now preprocesses queries usingpostprocess_query, which enhances flexibility. Ensure that this change does not impact existing functionality.README.md (1)
113-117: LGTM:postprocess_querymethod in the README is well-documented.The method is clearly documented as a placeholder for subclass customization, providing guidance on when to override it.
Summary by CodeRabbit
postprocess_querymethod in theStorageProviderclass to enhance query processing flexibility.