-
Notifications
You must be signed in to change notification settings - Fork 88
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
No module named "grpc_interceptor" error #1193
Comments
I recently encountered the same issue we've using the spanner client with no issue for months and it's failing today. Python version: 3.10
|
Same for Apache Airflow - https://github.com/apache/airflow/actions/runs/10708266123/job/29690485827#step:7:4358. our tests started to fail after 3.49.0 release today |
Google Cloud Spanner library released today has a missing grpc_intercept module. See: googleapis/python-spanner#1193
Google Cloud Spanner library released today has a missing grpc_intercept module. See: googleapis/python-spanner#1193
Also running into this issue today! |
Looks like 3.49.0 moved grpc-interceptor to extras/testing. When I test locally with google-cloud-spanner[testing] in requirements, grpc-interceptor is installed. |
Which is problematic because you do not want all the extra test dependencies when you have "production" dependency specification. For now I just added !=3.49.0 in Airflow and hope it is going to be fixed in 3.49.1 (in which case it will be automatically picked up and tested by Airflow) |
Here is the specific change. I agree with you when it comes to avoiding test dependency pollution. Looks like that is the only dependency in the testing extra. I opened a PR over at airflow, but might be best to wait and see if the google-cloud-spanner team reverts this change, or commits to this or another path forward. |
No - no - absolutely. We DON"T want to add test dependency there, so that PR is not going to be accepted. We already have 719 dependencies in airflow and we do not want to add "testing" to be there in the "production" dependencies - and if you do it this way, that is what is going to happen. The final solution can be one of two things:
2)If this is really "necessary" dependency for production - it should not be an extra Maybe the intention of spanner team is 1) but currently - at least as far as I can tell this is not the case, because spanner library imports the "grpc-interceptor" when just "import google.cloud.spanner_v1.instance happens - this means that (erronously in 3.49.0) "grpc-interceptor" is WRONGLY marked as testing dependncy because it is always required - so it SHOULD be in "Requires" section. Maybe the future version will change "grpc_interceptor" to be truly optional "test-only" dependency. If that will be the case, we will change our "devel" dependencies to include it - but currently, even if it is marked as "testing", it is "required" - which is the root cause of the problem. |
Also - to be perfectly blunt - if we workaround it in Airlfow by adding So yeah. Let's wait on how this problem will be solved by the spanner team and for now we just skip 3.49.0 as "buggy" (also my recommendation will be to yank this version when 3.49.1 is released - because as you saw - quite a feew users were affected in similar way. |
This PR #1195 should fix this issue. Please let me know your thoughts on this fix. Will this still lead to breakage? |
@harshachinta The fix looks acceptable. Curious to hear what @AmandaHassoun and @potiuk think. Would the team be able to yank the bad release as @potiuk mentioned above? @potiuk, assuming the above approach is taken, would these changes be acceptable in airflow? |
Not exactly those changes but the spirit is the same. It will have to be done somewhat differntly - not in hatch_build but in provider.yaml - because hatch_build will generate devel dependencies dynamically for google provider based on provider.yaml (and that for example means that when you do:
This will install all "google" and all "devel" dependencies of google are also installed (because it's an editable installation) but on the other hand:
Will NOT install those "devel" google dependencies. So we will have to add "devel-dependencies" similar to "amazon" one here: https://github.com/apache/airflow/blob/main/airflow/providers/amazon/provider.yaml#L139 But we can do it - no problem as soon as new version of spanner library is released. |
Environment details
3.11
google-cloud-spanner
version:3.49.0
, so latest releaseSteps to reproduce
google-cloud-spanner==3.49.0
Stack trace
I suspect this is related to this recent commit.
The text was updated successfully, but these errors were encountered: