🚀 Raise ValueError if response is empty in CouldForCustomers source#900
Draft
adrian-wojcik wants to merge 5 commits intodyvenia:devfrom
Draft
🚀 Raise ValueError if response is empty in CouldForCustomers source#900adrian-wojcik wants to merge 5 commits intodyvenia:devfrom
ValueError if response is empty in CouldForCustomers source#900adrian-wojcik wants to merge 5 commits intodyvenia:devfrom
Conversation
Release 0.4.26 PR
winiar93
approved these changes
May 8, 2024
winiar93
requested changes
Jun 18, 2024
Contributor
winiar93
left a comment
There was a problem hiding this comment.
please also apply changes for function _to_records_other
|
|
||
| ### Changed | ||
|
|
||
| - Changed `CloudForCustomers` methods: `_to_records_report` and `_to_records_other` to rasie ValueError if response from data source is empty |
Contributor
There was a problem hiding this comment.
Description doesn't match with code modification
| @@ -90,7 +90,6 @@ def _to_records_report(self, url: str) -> List[Dict[str, Any]]: | |||
| records.extend(new_records) | |||
|
|
|||
| url = response_json["d"].get("__next") | |||
Contributor
There was a problem hiding this comment.
Please consider to use solution from this code:
https://github.com/adrian-wojcik/viadot/blob/a62174515cf0326d1d15e32f151b609522d87b21/viadot/sources/cloud_for_customers.py
ValueError if response is empty in CouldForCustomers source
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adding new logic to raise ValueError with proper message if response from data source is empty
Importance
It is important for debugging process, as now it is more clear what is the issue if reposne will be empty
Checklist
This PR:
CONTRIBUTING.mdCHANGELOG.md