[BEAM-7577] Allow ValueProviders in Datastore Query filters#8950
[BEAM-7577] Allow ValueProviders in Datastore Query filters#8950udim merged 10 commits intoapache:masterfrom EDjur:BEAM-7577/allow-valueproviders-ReadFromDatastore
Conversation
|
R: @aaltay Appreciate any feedback and comments! |
|
Thanks for the feedback! Will push an update once I've run tests locally. Edit: Looks like my local pylint didn't catch the same issues as the one in Jenkins. Should be fixed now. |
|
@udim Made some edits based on your comments, let me know what you think! |
|
I've noticed that a small change might be needed in Since this function is run before the query is converted to a client_query by calling the I'm thinking that we should perhaps evaluate the values of our ValueProvider-filter before calculating the split. But this means we cannot evaluate in For context, the flow is essentially the Question is basically where the best place is to evaluate these filters. @udim What's your take on this? Edit: Will explore this again after fixing the other issue first. |
|
run python 2 postcommit |
|
run python 3.5 postcommit |
I would put in |
Yep noticed, I will revert the changes now :) |
Will this not raise an error due to calling One solution could be to just check in the query splitter if it is a ValueProvider and then execute |
|
Run Python PreCommit |
Yes, you're right. (I haven't written code that uses ValueProviders and it's trickier than it seems.) |
|
run python 3.5 postcommit |
My thoughts exactly 😬 Cheers for the code duplication fix! |
I have a use case where I need to supply Datastore Query filters at runtime. This PR allows the usage of ValueProviders when constructing the Datastore Query and converts them to their expected str-equivalents when running in a pipeline in _to_client_query().
Related Jira ticket: https://issues.apache.org/jira/browse/BEAM-7577
I have tested this by building my local version of beam and using it in the
sdk_locationflag when running a Dataflow job on GCP.Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username).[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.