Conversation
* Add empty input checks to uploader functions Added early return statements to uploader functions in upload.py to handle empty input lists, preventing unnecessary processing and logging debug messages. Also updated comments and TODOs for consistency in batch.py and upload.py. * Update upload.py * Refactor upload functions with skip_if_empty decorator Introduced a skip_if_empty decorator to reduce code duplication by handling empty input lists for upload functions. This change improves code readability and maintainability by centralizing the empty-check logic and debug logging. * Refactor empty list checks in uploader functions Simplified and unified empty list checks by removing redundant length checks in upload_files and upload_columns, and improving logic in skip_if_empty and upload_media_metrics. This streamlines the code and relies on existing mechanisms for handling empty inputs. * Improve skip_if_empty decorator argument handling Refactored the skip_if_empty decorator to use inspect for more robust detection of the first parameter, supporting both positional and keyword arguments. This ensures the decorator works correctly regardless of how the decorated function is called.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )