-
Notifications
You must be signed in to change notification settings - Fork 13
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
WIP - Feature/smart module filter #159
Merged
+143
−31
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d00de39
initial spike of feature
bencleary e527c3f
updated docs and worked through sample more
bencleary 13dbb59
tidied up python interface and added test
bencleary 6f61458
PR comments fix
bencleary 821ad83
rust changes implemented from PR feedback
bencleary a3f8c0b
Merge branch 'main' into feature/smart-module-filter
simlay be426fd
better error handling for consumerconfigwrapper
bencleary 6f60a5d
fixed linting errors
bencleary File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Binary file not shown.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#![allow(non_snake_case, unused)] | ||
|
||
include!(concat!(env!("OUT_DIR"), "/glue.rs")); | ||
include!(concat!(env!("OUT_DIR"), "/glue.rs")); | ||
bencleary marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
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.
I didn't catch it until I saw the stacktrace in CI but we should remove the
unwraps
. Due to the fact thatstd::fs::read
returns aResult<Vec<u8>, std::io::Error>
, let's make this return something likeResult<ConsumerConfigWrapper, std::io::Error>
.I'm a little hesitant to suggest it but given that
FluvioError
implementsFrom<IoError>
, this function could also just return aResult<ConsumerConfigWrapper, FluvioError>
and haveraw_buffer.as_ref().unwrap()
beraw_buffer.as_ref()?
. The?
here is called the question mark operator and is used to bubble up and handle various error types. Basically, it's syntactic sugar that roughly expands to:The reason I'm a little hesitant about using the base
FluvioError
is that the conversions to aFluvioError
(really just any rust error type) are done in that rust crate and are exposed upward. Something about having a library/crate that converts an io error downward a dependency's error rather than it's own error type feels wrong. That being said, I think I've done it before.Anyway, the
unwrap
causes this to segfault/panic rather than bubble up to the python as an exception. The Flapigen macros turns these error types into Strings (though, it can also return a typed error if we want) and raises them on the python side.What do you think? We could do the simple change on the error type in this PR and then create an issue or have a follow up PR exposing a more expressive type to the Python side.
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.
I will implement your first suggestion and return, sorry about the delay, i was having a weekend away from the computer!
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.
I have implemented your suggestion, it now looks like this:
The only bit i was unsure on, was in the
stream_with_config
method, i was unsure of how to handle the error from the result so i settled on this: