Skip to content
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

Log warning message when response_check attribute is passed in HttpSensorAsync #780

Merged
merged 2 commits into from Dec 1, 2022

Conversation

rajaths010494
Copy link
Contributor

Update the docstrings for HttpSensorAsync as discussed in https://astronomer.slack.com/archives/C0387PMM2E7/p1665393838125069..

image

closes #706

@codecov
Copy link

codecov bot commented Nov 25, 2022

Codecov Report

Base: 98.50% // Head: 98.50% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (d688ef3) compared to base (e006968).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #780   +/-   ##
=======================================
  Coverage   98.50%   98.50%           
=======================================
  Files          87       87           
  Lines        4745     4746    +1     
=======================================
+ Hits         4674     4675    +1     
  Misses         71       71           
Impacted Files Coverage Δ
astronomer/providers/http/sensors/http.py 84.61% <100.00%> (+0.61%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -42,7 +24,8 @@ def response_check(response, task_instance):
:type request_params: a dictionary of string key/value pairs
:param headers: The HTTP headers to be added to the GET request
:type headers: a dictionary of string key/value pairs
:param response_check: A check against the 'requests' response object.
:param response_check: This param is currently not supported.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove this param from the docstring here altogether since we're not supporting it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, agreed with @pankajkoti can we remove this?

Copy link
Collaborator

@kaxil kaxil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this? Removing docstring won't mean that the param isn't supported for Async.

Instead just add a log.warn line in the Operator's init or execute method to say it will use Synchronous operation since you passed response_check

@rajaths010494
Copy link
Contributor Author

Why remove this? Removing docstring won't mean that the param isn't supported for Async.

Instead just add a log.warn line in the Operator's init or execute method to say it will use Synchronous operation since you passed response_check

Yes sure will add the log message.

@kaxil kaxil merged commit 9f0c161 into main Dec 1, 2022
@kaxil kaxil deleted the Update-docs-of-http branch December 1, 2022 01:01
@bharanidharan14 bharanidharan14 changed the title Correct docstrings for HttpSensorAsync Log warning message when response_check attribute is passed in HttpSensorAsync Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Correct docstrings for HttpSensorAsync
5 participants