-
Notifications
You must be signed in to change notification settings - Fork 73
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
fix(taps): Do not emit a warning needlessly when rest_method
is not set in a stream class
#2870
fix(taps): Do not emit a warning needlessly when rest_method
is not set in a stream class
#2870
Conversation
… set in a stream class
Reviewer's Guide by SourceryThe pull request fixes an issue where a warning was unnecessarily emitted when Sequence diagram for HTTP method resolution in RESTStreamsequenceDiagram
participant Client
participant RESTStream
Client->>RESTStream: Get HTTP method
alt _http_method is set
RESTStream-->>Client: Return _http_method
else rest_method exists
Note over RESTStream: Emit deprecation warning
RESTStream-->>Client: Return rest_method
else
RESTStream-->>Client: Return default 'GET'
end
Class diagram showing RESTStream and GraphQLStream changesclassDiagram
class RESTStream {
-_http_method: str
+http_method(): str
+set_http_method(value: str)
+get_url(context: Context): str
}
class GraphQLStream {
+path: str
+http_method: str
+records_jsonpath: str
}
GraphQLStream --|> RESTStream
note for RESTStream "Removed deprecated rest_method property"
note for GraphQLStream "Changed from rest_method to http_method"
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2870 +/- ##
==========================================
- Coverage 91.34% 91.33% -0.01%
==========================================
Files 62 62
Lines 5209 5203 -6
Branches 673 675 +2
==========================================
- Hits 4758 4752 -6
Misses 319 319
Partials 132 132 ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #2870 will not alter performanceComparing Summary
|
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.
Hey @edgarrmondragon - I've reviewed your changes - here's some feedback:
Overall Comments:
- In the http_method getter, the condition checking for hasattr(self, "rest_method") might match both an instance‐set attribute and a lingering class property, which can be confusing. Consider checking the instance dictionary (e.g. using 'if "rest_method" in self.dict') to ensure you only warn when a deprecated instance attribute is set.
- In the tests you first assert that the 'rest_method' attribute is absent, but then assign to it in a later scenario. Adding an inline comment explaining why it's intentionally re-added (to test backward compatibility and proper warning behavior) could improve clarity.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Related
Use http_method instead
warning despite not declaringrest_method
#2869Summary by Sourcery
Replace the deprecated
rest_method
property withhttp_method
in REST and GraphQL streams.Bug Fixes:
rest_method
was not set in a stream class.Enhancements:
Tests:
rest_method
tohttp_method
.📚 Documentation preview 📚: https://meltano-sdk--2870.org.readthedocs.build/en/2870/