Add filter to get all transactions methods#19
Open
JohnLZeller wants to merge 2 commits intoSynapseFI:masterfrom
Open
Add filter to get all transactions methods#19JohnLZeller wants to merge 2 commits intoSynapseFI:masterfrom
JohnLZeller wants to merge 2 commits intoSynapseFI:masterfrom
Conversation
|
@JohnLZeller, thanks for the PR.
Either that, or a JSON-serializable object. And I guess the code would be something along those lines: if filter is None:
pass # No filter, don’t serialize.
elif isinstance(filter, str):
try:
_ = json.loads(filter) # All good, a valid JSON string.
except json.decoder.JSONDecodeError as e:
raise ValueError("filter is not a valid JSON string") from e
else:
try:
filter = json.dumps(filter) # All good, a JSON serializable object.
except TypeError as e:
raise ValueError("filter is not JSON serializable") from e
# Continue to use `filter` as JSON serialized string.
That’d be great 👍🏼 |
Author
|
@jenstroeger no problem, how's this! :) |
99283da to
edd7fbe
Compare
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.
The Synapse API supports using a filter string in calls to get all transactions, however, this package does not support this feature.
The API docs show this input as a string, though it's more than that, it should be a valid JSON string. This PR is the barebones approach, user is responsible for making the input a string. An alternative could obviously be to handle JSON serializing the string if it's possible, automatically under the hood. Happy to do that if you'd prefer.