fix(py-sdk): lowercase gRPC metadata headers for Python compatibility#359
fix(py-sdk): lowercase gRPC metadata headers for Python compatibility#359coding-shalabh wants to merge 1 commit intoMeesho:mainfrom
Conversation
…lity Python grpcio rejects metadata keys containing uppercase characters (HTTP/2 spec requires lowercase). The Go SDK works because Go's grpc library auto-lowercases keys, but Python's grpcio does not. Changed HEADER_CALLER_ID and HEADER_CALLER_TOKEN to lowercase to match the Go server middleware expectations in middleware.go. Fixes Meesho#165
PR Validation FailedPR description validation failed Issues found:
Please fill out the form to fix this: Open Form |
|
Links: Reason: 📘 Please check the Turbo Turtle FAQs for more details. 👉 If the reason is not self-explanatory or not covered in the FAQ, please reach out to @devops-oncall in the #devops-tech channel. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughUpdated gRPC authentication header constants from uppercase to lowercase format in the Python gRPC feature client. The changes modify two public header constants to use lowercase ASCII characters, aligning with HTTP/2 metadata requirements enforced by Python gRPC. Changes
Assessment against linked issues
Suggested labels
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required. |
erk1nya
left a comment
There was a problem hiding this comment.
Disregard previous approval - was automated test
What type of PR is this?
Description
🔁 Pull Request Template – BharatMLStack
Context:
Python gRPC clients fail with
metadata was invaliderror because header keys use uppercase characters, which violates HTTP/2 spec (RFC 7540 §8.1.2). Go grpc auto-lowercases keys, but Python grpcio rejects them.Describe your changes:
Lowercased
HEADER_CALLER_IDandHEADER_CALLER_TOKENconstants inpy-sdk/grpc_feature_client/grpc_feature_client/client.pyto match the Go server middleware expectations and comply with HTTP/2 header requirements.Checklist before requesting a review
📂 Modules Affected
horizon(Real-time systems / networking)online-feature-store(Feature serving infra)trufflebox-ui(Admin panel / UI)infra(Docker, CI/CD, GCP/AWS setup)docs(Documentation updates)py-sdk✅ Type of Change
___________📊 Benchmark / Metrics (if applicable)
N/A — constant value change only.
Key Requirement Doc
Pod Type:
Why KRD is not required?
This is a one-line bug fix changing constant values from uppercase to lowercase. No architectural or design decisions involved.
Added Tests
If yes, what is the strategy?
Root Cause
The Python SDK defined gRPC metadata headers with uppercase characters:
Python
grpcioenforces RFC 7540 §8.1.2 strictly: HTTP/2 header names MUST be lowercase. Gogrpc-goauto-lowercases metadata keys, so the Go SDK works. Python grpcio does not auto-lowercase and rejects them.Fix
These match the server-side constants in
online-feature-store/internal/server/grpc/middleware.go.Fixes #165